/**
 *
 */
import OpenApi;
import OpenApi.OpenApiUtil;

extends OpenApi;


init(config: OpenApiUtil.Config){
  super(config);
  @signatureAlgorithm = 'v2';
  @endpointRule = 'regional';
  @endpointMap = {
    'cn-hangzhou' = 'vod.cn-shanghai.aliyuncs.com',
    'ap-northeast-2-pop' = 'vod.aliyuncs.com',
    'ap-southeast-2' = 'vod.aliyuncs.com',
    'ap-southeast-3' = 'vod.aliyuncs.com',
    'cn-beijing-finance-1' = 'vod.aliyuncs.com',
    'cn-beijing-finance-pop' = 'vod.aliyuncs.com',
    'cn-beijing-gov-1' = 'vod.aliyuncs.com',
    'cn-beijing-nu16-b01' = 'vod.aliyuncs.com',
    'cn-chengdu' = 'vod.aliyuncs.com',
    'cn-edge-1' = 'vod.aliyuncs.com',
    'cn-fujian' = 'vod.aliyuncs.com',
    'cn-haidian-cm12-c01' = 'vod.aliyuncs.com',
    'cn-hangzhou-bj-b01' = 'vod.aliyuncs.com',
    'cn-hangzhou-finance' = 'vod.aliyuncs.com',
    'cn-hangzhou-internal-prod-1' = 'vod.aliyuncs.com',
    'cn-hangzhou-internal-test-1' = 'vod.aliyuncs.com',
    'cn-hangzhou-internal-test-2' = 'vod.aliyuncs.com',
    'cn-hangzhou-internal-test-3' = 'vod.aliyuncs.com',
    'cn-hangzhou-test-306' = 'vod.aliyuncs.com',
    'cn-hongkong-finance-pop' = 'vod.aliyuncs.com',
    'cn-huhehaote' = 'vod.aliyuncs.com',
    'cn-huhehaote-nebula-1' = 'vod.aliyuncs.com',
    'cn-qingdao' = 'vod.aliyuncs.com',
    'cn-qingdao-nebula' = 'vod.aliyuncs.com',
    'cn-shanghai-et15-b01' = 'vod.aliyuncs.com',
    'cn-shanghai-et2-b01' = 'vod.aliyuncs.com',
    'cn-shanghai-finance-1' = 'vod.aliyuncs.com',
    'cn-shanghai-inner' = 'vod.aliyuncs.com',
    'cn-shanghai-internal-test-1' = 'vod.aliyuncs.com',
    'cn-shenzhen-finance-1' = 'vod.aliyuncs.com',
    'cn-shenzhen-inner' = 'vod.aliyuncs.com',
    'cn-shenzhen-st4-d01' = 'vod.aliyuncs.com',
    'cn-shenzhen-su18-b01' = 'vod.aliyuncs.com',
    'cn-wuhan' = 'vod.aliyuncs.com',
    'cn-wulanchabu' = 'vod.aliyuncs.com',
    'cn-yushanfang' = 'vod.aliyuncs.com',
    'cn-zhangbei' = 'vod.aliyuncs.com',
    'cn-zhangbei-na61-b01' = 'vod.aliyuncs.com',
    'cn-zhangjiakou-na62-a01' = 'vod.aliyuncs.com',
    'cn-zhengzhou-nebula-1' = 'vod.aliyuncs.com',
    'eu-west-1-oxs' = 'vod.aliyuncs.com',
    'me-east-1' = 'vod.aliyuncs.com',
    'rus-west-1-pop' = 'vod.aliyuncs.com',
    'us-east-1' = 'vod.aliyuncs.com',
  };

  checkConfig(config);
  @endpoint = getEndpoint('vod', @regionId, @endpointRule, @network, @suffix, @endpointMap, @endpoint);
}

function getEndpoint(productId: string, regionId: string, endpointRule: string, network: string, suffix: string, endpointMap: map[string]string, endpoint: string) throws: string{
  if (!$isNull(endpoint)) {
    return endpoint;
  }
  
  if (!$isNull(endpointMap) && !$isNull(endpointMap[regionId])) {
    return endpointMap[regionId];
  }
  return OpenApiUtil.getEndpointRules(productId, regionId, endpointRule, network, suffix);
}

model AppInfoDTO {
  appName?: string(name='AppName'),
  appType?: int32(name='AppType', example='1-普通应用，2-内嵌SDK.'),
  gmtCreate?: string(name='GmtCreate'),
  itemId?: string(name='ItemId'),
  platforms?: [ 
    {
      itemId?: string(name='ItemId'),
      licenseItemIds?: [ string ](name='LicenseItemIds'),
      pkgName?: string(name='PkgName'),
      pkgSignature?: string(name='PkgSignature'),
      platformType?: long(name='PlatformType'),
      type?: long(name='Type'),
    }
  ](name='Platforms'),
  userId?: long(name='UserId'),
}

model LicenseInstanceAppDTO {
  appId?: string(name='AppId'),
  beginOn?: string(name='BeginOn'),
  contractNo?: string(name='ContractNo'),
  creationTime?: string(name='CreationTime'),
  expiredOn?: string(name='ExpiredOn'),
  instanceId?: string(name='InstanceId'),
  itemId?: string(name='ItemId'),
  licenseConfigs?: [ 
    {
      businessType?: string(name='BusinessType'),
      featureIds?: string(name='FeatureIds'),
      isTrial?: boolean(name='IsTrial'),
      sdkId?: int32(name='SdkId'),
      sdkName?: string(name='SdkName'),
      subscription?: string(name='Subscription'),
      subscriptionImp?: string(name='SubscriptionImp'),
      subscriptionPkg?: string(name='SubscriptionPkg'),
    }
  ](name='LicenseConfigs'),
  modificationTime?: string(name='ModificationTime'),
  status?: string(name='Status'),
  userId?: long(name='UserId'),
}

model AddAITemplateRequest {
  templateConfig?: string(name='TemplateConfig', description='The detailed configurations of the AI template. The value must be a JSON string. For more information, see [AITemplateConfig](~~89863#title-vd3-499-o36~~).

This parameter is required.', example='{"AuditItem":["terrorism","porn"],"AuditRange":["image-cover","text-title","video"],"AuditContent":["screen"],"AuditAutoBlock":"yes"}'),
  templateName?: string(name='TemplateName', description='The name of the AI template. The name can be up to 128 bytes in length.

This parameter is required.', example='AI-media-test'),
  templateType?: string(name='TemplateType', description='The type of the AI template. Valid values:

*   **AIMediaAudit**: automated review
*   **AIImage**: smart thumbnail

This parameter is required.', example='AIMediaAudit'),
}

model AddAITemplateResponseBody = {
  requestId?: string(name='RequestId', description='The request ID.', example='25818875-5F78-4A13-BEF6-****'),
  templateId?: string(name='TemplateId', description='The ID of the AI template.', example='1706a0063dd733f6a823ef32e0a5****'),
}

model AddAITemplateResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: AddAITemplateResponseBody(name='body'),
}

/**
 * @summary Adds an AI template for automated review and smart thumbnail tasks.
 *
 * @description *   Regions that support this operation: **China (Beijing)**, **China (Shanghai)**, and **Singapore**.
 * *   Before you add an AI template for automated review and smart thumbnail tasks, make sure that [automated review](https://ai.aliyun.com/vi/censor) and [smart thumbnail](https://ai.aliyun.com/vi/cover) are enabled.
 *
 * @param request AddAITemplateRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return AddAITemplateResponse
 */
async function addAITemplateWithOptions(request: AddAITemplateRequest, runtime: $RuntimeOptions): AddAITemplateResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.templateConfig)) {
    query['TemplateConfig'] = request.templateConfig;
  }
  if (!$isNull(request.templateName)) {
    query['TemplateName'] = request.templateName;
  }
  if (!$isNull(request.templateType)) {
    query['TemplateType'] = request.templateType;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'AddAITemplate',
    version = '2017-03-21',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Adds an AI template for automated review and smart thumbnail tasks.
 *
 * @description *   Regions that support this operation: **China (Beijing)**, **China (Shanghai)**, and **Singapore**.
 * *   Before you add an AI template for automated review and smart thumbnail tasks, make sure that [automated review](https://ai.aliyun.com/vi/censor) and [smart thumbnail](https://ai.aliyun.com/vi/cover) are enabled.
 *
 * @param request AddAITemplateRequest
 * @return AddAITemplateResponse
 */
async function addAITemplate(request: AddAITemplateRequest): AddAITemplateResponse {
  var runtime = new $RuntimeOptions{};
  return addAITemplateWithOptions(request, runtime);
}

model AddCategoryRequest {
  cateName?: string(name='CateName', description='The name of the category.

*   The value can be up to 64 bytes in length.
*   The value must be encoded in UTF-8.

This parameter is required.', example='test'),
  parentId?: long(name='ParentId', description='The ID of the parent category.

To obtain the category ID, perform the following steps: Log on to the [ApsaraVideo VOD console](https://vod.console.aliyun.com). Choose **Configuration Management** > **Media Management** > **Categories**. On the **Audio and Video / Image Category** or **Short Video Material Category** tab, view the category ID.

> *   If you specify this parameter, the system creates a subcategory under the parent category. If you leave this parameter empty, the system creates a level 1 category.
>*   You cannot modify, add, or delete level 1 categories of short video materials. You can create only subcategories under level 1 categories for short video materials. This parameter is required when you set `Type` to `material`.', example='100012****'),
  type?: string(name='Type', description='The type of the category. Valid values:

*   **default** (default): audio, video, and image files
*   **material**: short video materials', example='default'),
}

model AddCategoryResponseBody = {
  category?: {
    cateId?: long(name='CateId', description='The ID of the category. You can use the value of this parameter when you call the [UpdateCategory](~~UpdateCategory~~), [DeleteCategory](~~DeleteCategory~~), and [GetCategories](~~GetCategories~~) operations.', example='10020'),
    cateName?: string(name='CateName', description='The name of the category.', example='test'),
    level?: long(name='Level', description='The level of the category. Valid values:

*   **0**: level 1 category
*   **1**: level 2 category
*   **1**: level 3 category', example='1'),
    parentId?: long(name='ParentId', description='The ID of the parent category.', example='100012'),
    type?: string(name='Type', description='The type of the category. Valid values:

*   **default**: audio, video, and image files
*   **material**: short video materials', example='default'),
  }(name='Category', description='The information about the category.'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='25818875-5F78-4AF6-D7393642CA58****'),
}

model AddCategoryResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: AddCategoryResponseBody(name='body'),
}

/**
 * @summary Creates a video category. You can call this operation to categorize media assets including audio or video files, images, and short video materials in ApsaraVideo VOD. This simplifies the query and management of media assets.
 *
 * @description *   You can create a maximum of 3 levels of categories for audio, video, and image files and 2 levels of categories for short video materials. Each category level can contain a maximum of 100 subcategories. To create categories for audio and video files, set `Type` to `default`. To create categories for short video materials, set `Type` to `material`.
 * *   After you create a category, you can categorize media resources during upload or categorize the uploaded media resources. For more information, see [Manage video categories](https://help.aliyun.com/document_detail/86070.html).
 *
 * @param request AddCategoryRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return AddCategoryResponse
 */
async function addCategoryWithOptions(request: AddCategoryRequest, runtime: $RuntimeOptions): AddCategoryResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.cateName)) {
    query['CateName'] = request.cateName;
  }
  if (!$isNull(request.parentId)) {
    query['ParentId'] = request.parentId;
  }
  if (!$isNull(request.type)) {
    query['Type'] = request.type;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'AddCategory',
    version = '2017-03-21',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Creates a video category. You can call this operation to categorize media assets including audio or video files, images, and short video materials in ApsaraVideo VOD. This simplifies the query and management of media assets.
 *
 * @description *   You can create a maximum of 3 levels of categories for audio, video, and image files and 2 levels of categories for short video materials. Each category level can contain a maximum of 100 subcategories. To create categories for audio and video files, set `Type` to `default`. To create categories for short video materials, set `Type` to `material`.
 * *   After you create a category, you can categorize media resources during upload or categorize the uploaded media resources. For more information, see [Manage video categories](https://help.aliyun.com/document_detail/86070.html).
 *
 * @param request AddCategoryRequest
 * @return AddCategoryResponse
 */
async function addCategory(request: AddCategoryRequest): AddCategoryResponse {
  var runtime = new $RuntimeOptions{};
  return addCategoryWithOptions(request, runtime);
}

model AddEditingProjectRequest {
  coverURL?: string(name='CoverURL', description='The thumbnail URL of the online editing project. If you leave this parameter empty and materials exist on the video track in the timeline, the thumbnail of the first material is used by default.', example='https://demo.aliyundoc.com/6AB4D0E1E1C74468883516C2349D1FC2-6-2.png'),
  description?: string(name='Description', description='The description of the online editing project.', example='testtimeline001desciption'),
  division?: string(name='Division', description='The region in which ApsaraVideo VOD is activated.', example='cn-shanghai'),
  ownerAccount?: string(name='OwnerAccount'),
  ownerId?: string(name='OwnerId'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: string(name='ResourceOwnerId'),
  timeline?: string(name='Timeline', description='The timeline of the online editing project in JSON format. For more information about the structure, see [Timeline](https://help.aliyun.com/document_detail/52839.html).

If you leave this parameter empty, an empty timeline is created and the duration of the online editing project is zero.', example='{"VideoTracks":[{"VideoTrackClips":[{"MediaId":"cc3308ac5006aed55a54328bc3443****"},{"MediaId":"95948ddba24446b6aed5db985e78****"}]}]}'),
  title?: string(name='Title', description='The title of the online editing project.

This parameter is required.', example='testtimeline'),
}

model AddEditingProjectResponseBody = {
  project?: {
    creationTime?: string(name='CreationTime', description='The time when the online editing project was created. The time follows the ISO 8601 standard in the *yyyy-MM-dd*T*HH:mm:ss*Z format. The time is displayed in UTC.', example='2017-01-11T12:00:00Z'),
    description?: string(name='Description', description='The description of the online editing project.', example='testtimeline001desciption'),
    modifiedTime?: string(name='ModifiedTime', description='The time when the online editing project was last modified. The time follows the ISO 8601 standard in the *yyyy-MM-dd*T*HH:mm:ss*Z format. The time is displayed in UTC.', example='2017-01-11T13:00:00Z'),
    projectId?: string(name='ProjectId', description='The ID of the online editing project.', example='fb2101bf24bf4df34c4cb3187****'),
    status?: string(name='Status', description='The status of the online editing project. Valid values:

*   **Normal**: the online editing project is in draft.
*   **Producing**: the video is being produced.
*   **Produced**: the video is produced.
*   **ProduceFailed**: the video failed to be produced.', example='Normal'),
    title?: string(name='Title', description='The title of the online editing project.', example='testtimeline'),
  }(name='Project', description='The information about the online editing project. For more information about the structure, see [EditingProject](https://help.aliyun.com/document_detail/52839.html).'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='E4EBD2BF-5EB0-4476-8829-9D94E1B1****'),
}

model AddEditingProjectResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: AddEditingProjectResponseBody(name='body'),
}

/**
 * @summary Creates an online editing project.
 *
 * @description *   For more information about the online editing feature, see [Overview](https://help.aliyun.com/document_detail/95482.html).
 *
 * @param request AddEditingProjectRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return AddEditingProjectResponse
 */
async function addEditingProjectWithOptions(request: AddEditingProjectRequest, runtime: $RuntimeOptions): AddEditingProjectResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.coverURL)) {
    query['CoverURL'] = request.coverURL;
  }
  if (!$isNull(request.description)) {
    query['Description'] = request.description;
  }
  if (!$isNull(request.division)) {
    query['Division'] = request.division;
  }
  if (!$isNull(request.ownerAccount)) {
    query['OwnerAccount'] = request.ownerAccount;
  }
  if (!$isNull(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!$isNull(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!$isNull(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  if (!$isNull(request.timeline)) {
    query['Timeline'] = request.timeline;
  }
  if (!$isNull(request.title)) {
    query['Title'] = request.title;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'AddEditingProject',
    version = '2017-03-21',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Creates an online editing project.
 *
 * @description *   For more information about the online editing feature, see [Overview](https://help.aliyun.com/document_detail/95482.html).
 *
 * @param request AddEditingProjectRequest
 * @return AddEditingProjectResponse
 */
async function addEditingProject(request: AddEditingProjectRequest): AddEditingProjectResponse {
  var runtime = new $RuntimeOptions{};
  return addEditingProjectWithOptions(request, runtime);
}

model AddEditingProjectMaterialsRequest {
  materialIds?: string(name='MaterialIds', description='Separate multiple material IDs with commas (,). You can specify up to 10 IDs.

>  If you specify multiple materials, make sure that the materials are of the same type as specified in MaterialType.

This parameter is required.', example='d3251979f9fd41f2acb29ccda5a6f772'),
  materialType?: string(name='MaterialType', description='The type of the material. Valid values:

*   **video**
*   **audio**
*   **image**

This parameter is required.', example='video'),
  ownerAccount?: string(name='OwnerAccount'),
  ownerId?: string(name='OwnerId'),
  projectId?: string(name='ProjectId', description='The ID of the online editing project.

This parameter is required.', example='afa31b483b5c41609185de0e1b790579'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: string(name='ResourceOwnerId'),
}

model AddEditingProjectMaterialsResponseBody = {
  materialList?: [ 
    {
      cateId?: int32(name='CateId', description='The ID of the category.', example='1000487543'),
      cateName?: string(name='CateName', description='The category name of the material.', example='cate1'),
      coverURL?: string(name='CoverURL', description='The thumbnail URL.'),
      createTime?: string(name='CreateTime', description='The time when the material was created. The time follows the ISO 8601 standard in the *YYYY-MM-DD**Thh:mm:ss* format. The time is displayed in UTC.', example='2019-10-02T08:26Z'),
      customerId?: long(name='CustomerId', description='The ID of the user.', example='1234751840694470'),
      description?: string(name='Description', description='The description of the material.', example='test material'),
      duration?: float(name='Duration', description='The duration of the material. Unit: seconds. The value is accurate to four decimal places.', example='3690.2332'),
      materialId?: string(name='MaterialId', description='The ID of the material.', example='85befc4118b84c6723e53b80b1****'),
      materialType?: string(name='MaterialType', description='The type of the material. Valid values:

*   **video**
*   **audio**
*   **image**', example='video'),
      modifyTime?: string(name='ModifyTime', description='The time when the material was last updated. The time follows the ISO 8601 standard in the *YYYY-MM-DD**Thh:mm:ss* format. The time is displayed in UTC.', example='2022-11-25T07:28:34Z'),
      size?: long(name='Size', description='The size of the material.', example='1682694'),
      snapshots?: [ string ](name='Snapshots', description='The URLs of snapshots.'),
      spriteConfig?: string(name='SpriteConfig', description='The configuration of the sprite snapshot.', example='xxx'),
      sprites?: [ string ](name='Sprites', description='The URLs of sprite snapshots.'),
      status?: string(name='Status', description='The status of the material. Valid values:

*   **Normal**
*   **Uploading**
*   **UploadFail**', example='Normal'),
      tags?: string(name='Tags', description='The tag of the material. Multiple tags are separated by commas (,).', example='tag1,tag2'),
      title?: string(name='Title', description='The title of the material.', example='test'),
    }
  ](name='MaterialList', description='The materials.'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='85237CDA-0B54-5CED-BA10-A8A71AA13C1A'),
}

model AddEditingProjectMaterialsResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: AddEditingProjectMaterialsResponseBody(name='body'),
}

/**
 * @summary Adds one or more materials to an editing project.
 *
 * @param request AddEditingProjectMaterialsRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return AddEditingProjectMaterialsResponse
 */
async function addEditingProjectMaterialsWithOptions(request: AddEditingProjectMaterialsRequest, runtime: $RuntimeOptions): AddEditingProjectMaterialsResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.materialIds)) {
    query['MaterialIds'] = request.materialIds;
  }
  if (!$isNull(request.materialType)) {
    query['MaterialType'] = request.materialType;
  }
  if (!$isNull(request.ownerAccount)) {
    query['OwnerAccount'] = request.ownerAccount;
  }
  if (!$isNull(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!$isNull(request.projectId)) {
    query['ProjectId'] = request.projectId;
  }
  if (!$isNull(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!$isNull(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'AddEditingProjectMaterials',
    version = '2017-03-21',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Adds one or more materials to an editing project.
 *
 * @param request AddEditingProjectMaterialsRequest
 * @return AddEditingProjectMaterialsResponse
 */
async function addEditingProjectMaterials(request: AddEditingProjectMaterialsRequest): AddEditingProjectMaterialsResponse {
  var runtime = new $RuntimeOptions{};
  return addEditingProjectMaterialsWithOptions(request, runtime);
}

model AddTranscodeTemplateGroupRequest {
  appId?: string(name='AppId', description='The application ID. Default value: **app-1000000**. For more information, see [Use the multi-application service](https://help.aliyun.com/document_detail/113600.html).', example='app-****'),
  name?: string(name='Name', description='The name of the transcoding template group.

*   The name can be up to 128 bytes in length.
*   The value must be encoded in UTF-8.

> You must specify TranscodeTemplateGroupId or Name in the request.', example='transcodetemplate'),
  transcodeTemplateGroupId?: string(name='TranscodeTemplateGroupId', description='The ID of the transcoding template group. If a transcoding template group ID is specified, you can add transcoding templates to the template group.

> You must specify TranscodeTemplateGroupId or Name in the request.', example='4c71a339fe52b4fa6f4527****'),
  transcodeTemplateList?: string(name='TranscodeTemplateList', description='The configurations of the transcoding template. The value is a string in JSON format. For more information about the data structure, see [TranscodeTemplate](https://help.aliyun.com/document_detail/52839.html).

> *   If you do not specify this parameter, the transcoding job cannot be automatically created after you upload a video.
> *   If you do not need to set Width or Height, do not specify the corresponding parameter. You cannot set the value to an empty string, such as "Height":"".', example='[{"Video":{"Bitrate":"400","Codec":"H.264","Fps":"30","Height":""},"Definition":"SD","Container":{"Format":"mp4"},"TemplateName":"testName","MuxConfig":{},"Audio":{"Codec":"AAC","Bitrate":"64","Samplerate":"44100"}}]'),
}

model AddTranscodeTemplateGroupResponseBody = {
  requestId?: string(name='RequestId', description='The request ID.', example='25818875-5F78-4AF6-D7393642CA58****'),
  transcodeTemplateGroupId?: string(name='TranscodeTemplateGroupId', description='The ID of the transcoding template group.', example='34e908aa4024af7821c31f93a2a****'),
}

model AddTranscodeTemplateGroupResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: AddTranscodeTemplateGroupResponseBody(name='body'),
}

/**
 * @summary Creates a transcoding template group or adds transcoding templates to a transcoding template group.
 *
 * @description *   You cannot perform custom operations on transcoding template groups that are **locked** in the ApsaraVideo VOD console. You can call the [GetTranscodeTemplateGroup](~~GetTranscodeTemplateGroup~~) operation to query the information about a transcoding template group and check whether the transcoding template group is locked based on the value of the Locked parameter. You can call the [UpdateTranscodeTemplateGroup](~~UpdateTranscodeTemplateGroup~~) operation to unlock a transcoding template group if it is locked. Then, you can perform custom operations on the transcoding template group.
 * *   An Object Storage Service (OSS) bucket is required to store files that are used for transcoding. You cannot create a transcoding template group if no bucket is available. To activate a bucket, perform the following operations: Log on to the ApsaraVideo VOD console. In the left-side navigation pane, choose **Configuration Management > Media Management > Storage**. On the **Storage** page, activate the bucket that is allocated by ApsaraVideo VOD.
 * *   You cannot add transcoding templates to the **No Transcoding** template group.
 * *   You can create a maximum of 20 transcoding template groups.
 * *   You can add a maximum of 20 transcoding templates to a transcoding template group.
 * *   If you want to generate a URL for adaptive bitrate streaming, you can add video packaging templates to a transcoding template group. You can add a maximum of 10 video packaging templates to a transcoding template group. If you add more than 10 video packaging templates, URLs of the video transcoded based on the video packaging templates are generated but the URL for adaptive bitrate streaming is not generated.
 * ### QPS limits
 * You can call this operation up to five times per second per account. Requests that exceed this limit are dropped and you will experience service interruptions. We recommend that you take note of this limit when you call this operation. For more information, see [QPS limits](https://help.aliyun.com/document_detail/342790.html).
 *
 * @param request AddTranscodeTemplateGroupRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return AddTranscodeTemplateGroupResponse
 */
async function addTranscodeTemplateGroupWithOptions(request: AddTranscodeTemplateGroupRequest, runtime: $RuntimeOptions): AddTranscodeTemplateGroupResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.appId)) {
    query['AppId'] = request.appId;
  }
  if (!$isNull(request.name)) {
    query['Name'] = request.name;
  }
  if (!$isNull(request.transcodeTemplateGroupId)) {
    query['TranscodeTemplateGroupId'] = request.transcodeTemplateGroupId;
  }
  if (!$isNull(request.transcodeTemplateList)) {
    query['TranscodeTemplateList'] = request.transcodeTemplateList;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'AddTranscodeTemplateGroup',
    version = '2017-03-21',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Creates a transcoding template group or adds transcoding templates to a transcoding template group.
 *
 * @description *   You cannot perform custom operations on transcoding template groups that are **locked** in the ApsaraVideo VOD console. You can call the [GetTranscodeTemplateGroup](~~GetTranscodeTemplateGroup~~) operation to query the information about a transcoding template group and check whether the transcoding template group is locked based on the value of the Locked parameter. You can call the [UpdateTranscodeTemplateGroup](~~UpdateTranscodeTemplateGroup~~) operation to unlock a transcoding template group if it is locked. Then, you can perform custom operations on the transcoding template group.
 * *   An Object Storage Service (OSS) bucket is required to store files that are used for transcoding. You cannot create a transcoding template group if no bucket is available. To activate a bucket, perform the following operations: Log on to the ApsaraVideo VOD console. In the left-side navigation pane, choose **Configuration Management > Media Management > Storage**. On the **Storage** page, activate the bucket that is allocated by ApsaraVideo VOD.
 * *   You cannot add transcoding templates to the **No Transcoding** template group.
 * *   You can create a maximum of 20 transcoding template groups.
 * *   You can add a maximum of 20 transcoding templates to a transcoding template group.
 * *   If you want to generate a URL for adaptive bitrate streaming, you can add video packaging templates to a transcoding template group. You can add a maximum of 10 video packaging templates to a transcoding template group. If you add more than 10 video packaging templates, URLs of the video transcoded based on the video packaging templates are generated but the URL for adaptive bitrate streaming is not generated.
 * ### QPS limits
 * You can call this operation up to five times per second per account. Requests that exceed this limit are dropped and you will experience service interruptions. We recommend that you take note of this limit when you call this operation. For more information, see [QPS limits](https://help.aliyun.com/document_detail/342790.html).
 *
 * @param request AddTranscodeTemplateGroupRequest
 * @return AddTranscodeTemplateGroupResponse
 */
async function addTranscodeTemplateGroup(request: AddTranscodeTemplateGroupRequest): AddTranscodeTemplateGroupResponse {
  var runtime = new $RuntimeOptions{};
  return addTranscodeTemplateGroupWithOptions(request, runtime);
}

model AddVodDomainRequest {
  checkUrl?: string(name='CheckUrl', description='The URL that is used for health checks.', example='www.example.com/test.html'),
  domainName?: string(name='DomainName', description='The domain name that you want to accelerate. Wildcard domain names that start with periods (.) are supported. Example: .example.com.

This parameter is required.', example='example.com'),
  ownerAccount?: string(name='OwnerAccount'),
  ownerId?: long(name='OwnerId'),
  scope?: string(name='Scope', description='This parameter is applicable to users of level 3 or higher in the Chinese mainland and users outside the Chinese mainland. Default value: domestic. Valid values:

*   **domestic**: Chinese mainland
*   **overseas**: outside the Chinese mainland
*   **global**: regions in and outside the Chinese mainland', example='domestic'),
  securityToken?: string(name='SecurityToken'),
  sources?: string(name='Sources', description='The information about the addresses of origin servers. For more information, see the **Sources** table in this topic.

This parameter is required.', example='[{"content":"1.1.1.1","type":"ipaddr","priority":"20","port":80}]'),
  topLevelDomain?: string(name='TopLevelDomain', description='The top-level domain.', example='example.com'),
}

model AddVodDomainResponseBody = {
  requestId?: string(name='RequestId', description='The ID of the request.', example='15C66C7B-671A-4297-****-2C4477247A74'),
}

model AddVodDomainResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: AddVodDomainResponseBody(name='body'),
}

/**
 * @summary Adds a domain name to accelerate in ApsaraVideo VOD.
 *
 * @description *   This operation is available only in the **China (Shanghai)** region.
 * *   Before you add a domain name to accelerate, you must activate ApsaraVideo VOD and apply for an Internet content provider (ICP) filing for the domain name. For more information about how to activate ApsaraVideo VOD, see [Activate ApsaraVideo VOD](https://help.aliyun.com/document_detail/51512.html).
 * *   If the content on the origin server is not stored on Alibaba Cloud, the content must be reviewed by Alibaba Cloud. The review will be complete by the end of the next business day after you submit an application.
 * *   You can add only one domain name to accelerate in a request. You can add a maximum of 20 accelerated domain names within an Alibaba Cloud account.
 *
 * @param request AddVodDomainRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return AddVodDomainResponse
 */
async function addVodDomainWithOptions(request: AddVodDomainRequest, runtime: $RuntimeOptions): AddVodDomainResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.checkUrl)) {
    query['CheckUrl'] = request.checkUrl;
  }
  if (!$isNull(request.domainName)) {
    query['DomainName'] = request.domainName;
  }
  if (!$isNull(request.ownerAccount)) {
    query['OwnerAccount'] = request.ownerAccount;
  }
  if (!$isNull(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!$isNull(request.scope)) {
    query['Scope'] = request.scope;
  }
  if (!$isNull(request.securityToken)) {
    query['SecurityToken'] = request.securityToken;
  }
  if (!$isNull(request.sources)) {
    query['Sources'] = request.sources;
  }
  if (!$isNull(request.topLevelDomain)) {
    query['TopLevelDomain'] = request.topLevelDomain;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'AddVodDomain',
    version = '2017-03-21',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Adds a domain name to accelerate in ApsaraVideo VOD.
 *
 * @description *   This operation is available only in the **China (Shanghai)** region.
 * *   Before you add a domain name to accelerate, you must activate ApsaraVideo VOD and apply for an Internet content provider (ICP) filing for the domain name. For more information about how to activate ApsaraVideo VOD, see [Activate ApsaraVideo VOD](https://help.aliyun.com/document_detail/51512.html).
 * *   If the content on the origin server is not stored on Alibaba Cloud, the content must be reviewed by Alibaba Cloud. The review will be complete by the end of the next business day after you submit an application.
 * *   You can add only one domain name to accelerate in a request. You can add a maximum of 20 accelerated domain names within an Alibaba Cloud account.
 *
 * @param request AddVodDomainRequest
 * @return AddVodDomainResponse
 */
async function addVodDomain(request: AddVodDomainRequest): AddVodDomainResponse {
  var runtime = new $RuntimeOptions{};
  return addVodDomainWithOptions(request, runtime);
}

model AddVodStorageForAppRequest {
  appId?: string(name='AppId', description='The IDs of applications. You can obtain the application ID from the `AppId` parameter in the response to the [CreateAppInfo](~~CreateAppInfo~~) or [ListAppInfo](~~ListAppInfo~~) operation.

This parameter is required.', example='app-****'),
  storageLocation?: string(name='StorageLocation', description='The address of an Object Storage Service (OSS) bucket. This parameter does not take effect. You can call this operation to add only VOD buckets.', example='out-****.oss-cn-shanghai.aliyuncs.com'),
  storageType?: string(name='StorageType', description='The storage class. Default value: **vod_oss_bucket**.', example='vod_oss_bucket'),
}

model AddVodStorageForAppResponseBody = {
  requestId?: string(name='RequestId', description='The ID of the request.', example='25818875-5F78-4A*****F6-D7393642CA58'),
  storageLocation?: string(name='StorageLocation', description='The address of the VOD bucket.', example='out-****.oss-cn-shanghai.aliyuncs.com'),
}

model AddVodStorageForAppResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: AddVodStorageForAppResponseBody(name='body'),
}

/**
 * @summary Binds a storage bucket to one or more applications in ApsaraVideo VOD.
 *
 * @description You can call this operation to add a buckets to an ApsaraVideo VOD applications.
 * > You can add only one ApsaraVideo VOD bucket for each application. If you specify an AppId that does not exist or the ID of an application for which an VOD bucket is enabled, an error is returned.
 *
 * @param request AddVodStorageForAppRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return AddVodStorageForAppResponse
 */
async function addVodStorageForAppWithOptions(request: AddVodStorageForAppRequest, runtime: $RuntimeOptions): AddVodStorageForAppResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.appId)) {
    query['AppId'] = request.appId;
  }
  if (!$isNull(request.storageLocation)) {
    query['StorageLocation'] = request.storageLocation;
  }
  if (!$isNull(request.storageType)) {
    query['StorageType'] = request.storageType;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'AddVodStorageForApp',
    version = '2017-03-21',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Binds a storage bucket to one or more applications in ApsaraVideo VOD.
 *
 * @description You can call this operation to add a buckets to an ApsaraVideo VOD applications.
 * > You can add only one ApsaraVideo VOD bucket for each application. If you specify an AppId that does not exist or the ID of an application for which an VOD bucket is enabled, an error is returned.
 *
 * @param request AddVodStorageForAppRequest
 * @return AddVodStorageForAppResponse
 */
async function addVodStorageForApp(request: AddVodStorageForAppRequest): AddVodStorageForAppResponse {
  var runtime = new $RuntimeOptions{};
  return addVodStorageForAppWithOptions(request, runtime);
}

model AddVodTemplateRequest {
  appId?: string(name='AppId', description='The ID of the application. Default value: **app-1000000**. For more information, see [Multi-application service](https://help.aliyun.com/document_detail/113600.html).', example='app-****'),
  name?: string(name='Name', description='The name of the template.

*   The name cannot exceed 128 bytes.
*   The value must be encoded in UTF-8.

This parameter is required.', example='test'),
  templateConfig?: string(name='TemplateConfig', description='The configurations of the snapshot template. The value must be a JSON string. For more information about the data structure, see [SnapshotTemplateConfig](https://help.aliyun.com/document_detail/98618.html) and [DynamicImageTemplateConfig](https://help.aliyun.com/document_detail/98618.html).

This parameter is required.', example='{"SnapshotConfig":{"Count":10,"SpecifiedOffsetTime":0,"Interval":1,"FrameType":"normal"},"SnapshotType":"NormalSnapshot"}'),
  templateType?: string(name='TemplateType', description='The type of the template. Set the value to **Snapshot**.

This parameter is required.', example='Snapshot'),
}

model AddVodTemplateResponseBody = {
  requestId?: string(name='RequestId', description='The ID of the request.', example='25818875-5F78-4A*****F6-D7393642CA58'),
  vodTemplateId?: string(name='VodTemplateId', description='The ID of the snapshot template. You can call the [SubmitSnapshotJob](https://help.aliyun.com/document_detail/72213.html) operation to submit snapshot jobs.', example='f5b228fe6930e*****0d6bf55bd87789'),
}

model AddVodTemplateResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: AddVodTemplateResponseBody(name='body'),
}

/**
 * @summary Adds a snapshot template or frame animation template.
 *
 * @description *   After you add a snapshot template, you can call the [SubmitSnapshotJob](https://help.aliyun.com/document_detail/72213.html) operation and specify the template ID to submit a snapshot job.
 * *   You can use the HTTP (HTTPS compatible) callback or MNS callback method to receive the [SnapshotComplete](https://help.aliyun.com/document_detail/57337.html) callback. For more information, see [Overview](https://help.aliyun.com/document_detail/55627.html).
 *
 * @param request AddVodTemplateRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return AddVodTemplateResponse
 */
async function addVodTemplateWithOptions(request: AddVodTemplateRequest, runtime: $RuntimeOptions): AddVodTemplateResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.appId)) {
    query['AppId'] = request.appId;
  }
  if (!$isNull(request.name)) {
    query['Name'] = request.name;
  }
  if (!$isNull(request.templateConfig)) {
    query['TemplateConfig'] = request.templateConfig;
  }
  if (!$isNull(request.templateType)) {
    query['TemplateType'] = request.templateType;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'AddVodTemplate',
    version = '2017-03-21',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Adds a snapshot template or frame animation template.
 *
 * @description *   After you add a snapshot template, you can call the [SubmitSnapshotJob](https://help.aliyun.com/document_detail/72213.html) operation and specify the template ID to submit a snapshot job.
 * *   You can use the HTTP (HTTPS compatible) callback or MNS callback method to receive the [SnapshotComplete](https://help.aliyun.com/document_detail/57337.html) callback. For more information, see [Overview](https://help.aliyun.com/document_detail/55627.html).
 *
 * @param request AddVodTemplateRequest
 * @return AddVodTemplateResponse
 */
async function addVodTemplate(request: AddVodTemplateRequest): AddVodTemplateResponse {
  var runtime = new $RuntimeOptions{};
  return addVodTemplateWithOptions(request, runtime);
}

model AddWatermarkRequest {
  appId?: string(name='AppId', description='The ID of the application. Default value: **app-1000000**. If you have activated the multi-application service, specify the ID of the application to add the watermark template in the specified application. For more information, see [Overview](https://help.aliyun.com/document_detail/113600.html).', example='app-****'),
  fileUrl?: string(name='FileUrl', description='The URL of the watermark file. The URL must be an Object Storage Service (OSS) URL and cannot contain the information used for URL signing.

> *   This parameter is required if you set `Type` to `Image`.
> *  You can obtain the URL from the `FileURL` parameter in the response to the [CreateUploadAttachedMedia](~~CreateUploadAttachedMedia~~) operation that you call to upload the watermark image to ApsaraVideo VOD.', example='http://outin-326268*****63e1403e7.oss-cn-shanghai.aliyuncs.com/image/cover/C99345*****E7FDEC-6-2.png'),
  name?: string(name='Name', description='The name of the watermark template.

*   Only letters and digits are supported.
*   The name cannot exceed 128 bytes.
*   The value must be encoded in UTF-8.

This parameter is required.', example='watermark'),
  type?: string(name='Type', description='The type of the watermark template. Valid values:

*   **Image** (default): image watermark template
*   **Text**: text watermark template

This parameter is required.', example='Text'),
  watermarkConfig?: string(name='WatermarkConfig', description='The configuration information of the watermark such as the display position and special effects. The value must be a JSON string. The configuration parameters for image and text watermarks are different. For more information about the parameter structure, see [WatermarkConfig](~~98618#section-h01-44s-2lr~~).

This parameter is required.', example='{"Width":"55","Height":"55","Dx":"9","Dy":"9","ReferPos":"BottonLeft"}'),
}

model AddWatermarkResponseBody = {
  requestId?: string(name='RequestId', description='The ID of the request.', example='25818875-5F78-4A*****F6-D7393642CA58'),
  watermarkInfo?: {
    creationTime?: string(name='CreationTime', description='The time when the watermark template was created. The time follows the ISO 8601 standard in the *yyyy-MM-dd*T*HH:mm:ss*Z format. The time is displayed in UTC.', example='2018-11-07T09:05:52Z'),
    fileUrl?: string(name='FileUrl', description='The URL of the watermark file. The URL is an Object Storage Service (OSS) URL or an Alibaba Cloud CDN URL.

>  This parameter is returned only for image watermark templates.', example='https://outin-3262*****9f4b3e7.oss-cn-shanghai.aliyuncs.com/image/cover/E6C3448CC8B715E6F8A72EC6B-6-2.png?Expires=1541600583&OSSAccessKeyId=****&Signature=gmf1eYMoDVg%2BHQCb4UGozBW****'),
    isDefault?: string(name='IsDefault', description='Indicates whether the watermark template is the default one. Valid values:

*   **Default**
*   **NotDefault**', example='NotDefault'),
    name?: string(name='Name', description='The name of the watermark template.', example='text watermark test'),
    type?: string(name='Type', description='The type of the watermark template.

*   **Image**: image watermark template
*   **Text**: text watermark template', example='Text'),
    watermarkConfig?: string(name='WatermarkConfig', description='The configuration information of the watermark such as the display position and special effects. The value is a JSON string. The configuration parameters for image and text watermarks are different. For more information about the parameter structure, see [WatermarkConfig](~~98618#section-h01-44s-2lr~~).', example='{"FontColor": "Blue","FontSize": 80, "Content": "watermark test" }'),
    watermarkId?: string(name='WatermarkId', description='The ID of the watermark template.', example='9bcc8bfadb84*****109a2671d0df97'),
  }(name='WatermarkInfo', description='The information about the watermark template.'),
}

model AddWatermarkResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: AddWatermarkResponseBody(name='body'),
}

/**
 * @summary Creates an image or text watermark. ApsaraVideo VOD allows you to create watermark templates to reuse your parameter configurations such as watermark position, size, font, and color. Each watermark template is assigned a unique ID. This simplifies the progress of creating watermark tasks.
 *
 * @description *   You can call this operation to create an `Image` watermark template or a `Text` watermark template. You can use static images in the PNG format or dynamic images in the GIF, APNG, and MOV formats as image watermarks.
 * *   After you call this operation to create a watermark template, you must call the [AddTranscodeTemplateGroup](~~AddTranscodeTemplateGroup~~) or [UpdateTranscodeTemplateGroup](~~UpdateTranscodeTemplateGroup~~) operation to associate the watermark template with a transcoding template group. This way, you can add watermarks to videos during transcoding.
 * *   For more information, see [Video watermarks](https://help.aliyun.com/document_detail/99369.html).
 *
 * @param request AddWatermarkRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return AddWatermarkResponse
 */
async function addWatermarkWithOptions(request: AddWatermarkRequest, runtime: $RuntimeOptions): AddWatermarkResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.appId)) {
    query['AppId'] = request.appId;
  }
  if (!$isNull(request.fileUrl)) {
    query['FileUrl'] = request.fileUrl;
  }
  if (!$isNull(request.name)) {
    query['Name'] = request.name;
  }
  if (!$isNull(request.type)) {
    query['Type'] = request.type;
  }
  if (!$isNull(request.watermarkConfig)) {
    query['WatermarkConfig'] = request.watermarkConfig;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'AddWatermark',
    version = '2017-03-21',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Creates an image or text watermark. ApsaraVideo VOD allows you to create watermark templates to reuse your parameter configurations such as watermark position, size, font, and color. Each watermark template is assigned a unique ID. This simplifies the progress of creating watermark tasks.
 *
 * @description *   You can call this operation to create an `Image` watermark template or a `Text` watermark template. You can use static images in the PNG format or dynamic images in the GIF, APNG, and MOV formats as image watermarks.
 * *   After you call this operation to create a watermark template, you must call the [AddTranscodeTemplateGroup](~~AddTranscodeTemplateGroup~~) or [UpdateTranscodeTemplateGroup](~~UpdateTranscodeTemplateGroup~~) operation to associate the watermark template with a transcoding template group. This way, you can add watermarks to videos during transcoding.
 * *   For more information, see [Video watermarks](https://help.aliyun.com/document_detail/99369.html).
 *
 * @param request AddWatermarkRequest
 * @return AddWatermarkResponse
 */
async function addWatermark(request: AddWatermarkRequest): AddWatermarkResponse {
  var runtime = new $RuntimeOptions{};
  return addWatermarkWithOptions(request, runtime);
}

model AttachAppPolicyToIdentityRequest {
  appId?: string(name='AppId', description='The ID of the application. Default value: **app-1000000**. For more information, see [Multi-application service](https://help.aliyun.com/document_detail/113600.html).

> This parameter is optional only if you set the policy name to VODAppAdministratorAccess.', example='app-****'),
  identityName?: string(name='IdentityName', description='The ID of the RAM user or the name of the RAM role.

*   Specify the ID of the RAM user when the IdentityType parameter is set to RamUser.
*   Specify the name of the RAM role when the IdentityType parameter is set to RamRole.

This parameter is required.', example='****'),
  identityType?: string(name='IdentityType', description='The type of the identity. Valid values:

*   **RamUser**: a RAM user
*   **RamRole**: a RAM role

This parameter is required.', example='RamRole'),
  policyNames?: string(name='PolicyNames', description='The name of the policy. Only system policies are supported. Separate multiple policy names with commas (,). Valid values:

*   **VODAppFullAccess**: permissions to manage all resources in an application.
*   **VODAppReadOnlyAccess**: permissions to read all resources in an application.
*   **VODAppAdministratorAccess**: permissions of the application administrator.

This parameter is required.', example='VODAppFullAccess'),
}

model AttachAppPolicyToIdentityResponseBody = {
  failedPolicyNames?: [ string ](name='FailedPolicyNames', description='The names of the policies that failed to be granted to the RAM user or RAM role.'),
  nonExistPolicyNames?: [ string ](name='NonExistPolicyNames', description='The names of the policies that were not found.'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='25818875-5F78-4A13-****-D7393642CA58'),
}

model AttachAppPolicyToIdentityResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: AttachAppPolicyToIdentityResponseBody(name='body'),
}

/**
 * @summary Grants a RAM user or RAM role permissions to access ApsaraVideo VOD applications.
 *
 * @description > You can grant a RAM user or RAM role permissions to access up to 10 applications.
 *
 * @param request AttachAppPolicyToIdentityRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return AttachAppPolicyToIdentityResponse
 */
async function attachAppPolicyToIdentityWithOptions(request: AttachAppPolicyToIdentityRequest, runtime: $RuntimeOptions): AttachAppPolicyToIdentityResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.appId)) {
    query['AppId'] = request.appId;
  }
  if (!$isNull(request.identityName)) {
    query['IdentityName'] = request.identityName;
  }
  if (!$isNull(request.identityType)) {
    query['IdentityType'] = request.identityType;
  }
  if (!$isNull(request.policyNames)) {
    query['PolicyNames'] = request.policyNames;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'AttachAppPolicyToIdentity',
    version = '2017-03-21',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Grants a RAM user or RAM role permissions to access ApsaraVideo VOD applications.
 *
 * @description > You can grant a RAM user or RAM role permissions to access up to 10 applications.
 *
 * @param request AttachAppPolicyToIdentityRequest
 * @return AttachAppPolicyToIdentityResponse
 */
async function attachAppPolicyToIdentity(request: AttachAppPolicyToIdentityRequest): AttachAppPolicyToIdentityResponse {
  var runtime = new $RuntimeOptions{};
  return attachAppPolicyToIdentityWithOptions(request, runtime);
}

model BatchGetMediaInfosRequest {
  mediaIds?: string(name='MediaIds', description='The ID of the media asset. The ID can be the video ID or audio ID. Separate IDs with commas (,). You can specify a maximum of 20 IDs. You can use one of the following methods to obtain the ID of the media asset:

*   Log on to the ApsaraVideo VOD console. In the left-side navigation pane, choose Media Files > Audio/Video. On the Video and Audio page, view the ID of the media asset. This method is applicable to files that are uploaded by using the ApsaraVideo VOD console.
*   Obtain the value of VideoId from the response to the CreateUploadVideo operation that you call to upload media assets.
*   Obtain the value of VideoId from the response to the SearchMedia operation that you call to query the media ID after the media asset is uploaded.

This parameter is required.', example='61ccbdb06fa83012be4d8083f6****,7d2fbc380b0e08e55f****'),
}

model BatchGetMediaInfosResponseBody = {
  forbiddenMediaIds?: [ string ](name='ForbiddenMediaIds', description='The IDs of the media assets that do not support the operation typically because you are not authorized to perform the operation. For more information, see [Overview](https://help.aliyun.com/document_detail/113600.html).'),
  mediaInfos?: [ 
    {
      mediaId?: string(name='MediaId', description='The ID of the media asset.', example='10a5fa364a5b71ef89246733a78e****'),
      mediaInfo?: {
        appId?: string(name='AppId', description='The ID of the application.', example='app-****'),
        cateId?: long(name='CateId', description='The ID of the category.', example='781111****'),
        cateName?: string(name='CateName', description='The name of the category.', example='CateName'),
        coverURL?: string(name='CoverURL', description='The thumbnail URL of the media asset.', example='https://example.aliyundoc.com/****.jpg'),
        creationTime?: string(name='CreationTime', description='The time when the media asset was created. The time follows the ISO 8601 standard in the yyyy-MM-ddTHH:mm:ssZ format. The time is displayed in UTC.', example='2017-11-14T09:15:50Z'),
        description?: string(name='Description', description='The description of the media asset.', example='Aliyun VOD Video Description'),
        downloadSwitch?: string(name='DownloadSwitch', description='Indicates whether the offline download feature is enabled. If you enable the offline download feature, users can download and play videos by using the ApsaraVideo Player on a local PC. For more information, see [Configure download settings](https://help.aliyun.com/document_detail/86107.html). Valid values:

*   **on**
*   **off**', example='on'),
        mediaId?: string(name='MediaId', description='The ID of the media asset.', example='7753d144efd74d6c45fe0570****'),
        modificationTime?: string(name='ModificationTime', description='The time when the media asset was last updated. The time follows the ISO 8601 standard in the yyyy-MM-ddTHH:mm:ssZ format. The time is displayed in UTC.', example='2017-06-26T06:38:48Z'),
        restoreExpiration?: string(name='RestoreExpiration', description='The period of time in which the audio file remains in the restored state.', example='2023-03-30T10:14:14Z'),
        restoreStatus?: string(name='RestoreStatus', description='The restoration status of the media asset. Valid values:

*   **Processing**
*   **Success**
*   **Failed**', example='Success'),
        snapshots?: [ string ](name='Snapshots', description='The array of video snapshot URLs.'),
        status?: string(name='Status', description='The status of the video. Valid values:

*   **Uploading**
*   **UploadFail**
*   **UploadSucc**
*   **Transcoding**
*   **TranscodeFail**
*   **Blocked**
*   **Normal**', example='Normal'),
        storageClass?: string(name='StorageClass', description='The storage type. Valid values:

*   **Standard**: All media assets are stored as Standard objects.
*   **IA**: All media assets are stored as IA objects.
*   **Archive**: All media assets are stored as Archive objects.
*   **ColdArchive**: All media assets are stored as Cold Archive objects.
*   **SourceIA**: Only the source files are IA objects.
*   **SourceArchive**: Only the source files are Archive objects.
*   **SourceColdArchive**: Only the source file is stored as a Cold Archive object.
*   **Changing**: The storage class of the media asset is being changed.
*   **SourceChanging**: The storage class of the media asset is being changed.', example='Standard'),
        storageLocation?: string(name='StorageLocation', description='The storage address of the media asset.', example='outin-***.oss-cn-shanghai.aliyuncs.com'),
        tags?: string(name='Tags', description='The tags of the media asset. Separate tags with commas (,).', example='tag1,tag2'),
        templateGroupId?: string(name='TemplateGroupId', description='The ID of the transcoding template group.', example='b4039216985f4312a5382a4ed****'),
        title?: string(name='Title', description='The title of the media asset.', example='Aliyun VOD Video Title'),
        userData?: string(name='UserData', description='The custom parameters.', example='{"Extend":"xxx","MessageCallback":"xxx"}'),
      }(name='MediaInfo', description='The basic information of the media asset.'),
      mezzanineInfo?: {
        audioStreamList?: [ 
          {
            bitrate?: string(name='Bitrate', description='The bitrate.', example='62.885'),
            channelLayout?: string(name='ChannelLayout', description='The output layout of the audio channels. Valid values:

*   **mono**
*   **stereo**', example='mono'),
            channels?: string(name='Channels', description='The number of sound tracks.', example='1'),
            codecLongName?: string(name='CodecLongName', description='The full name of the encoding format.', example='AAC (Advanced Audio Coding)'),
            codecName?: string(name='CodecName', description='The short name of the encoding format.', example='aac'),
            codecTag?: string(name='CodecTag', description='The tag of the encoding format.', example='0x6134706d'),
            codecTagString?: string(name='CodecTagString', description='The tag string of the encoding format.', example='mp4a'),
            codecTimeBase?: string(name='CodecTimeBase', description='The time base of the encoder.', example='1/44100'),
            duration?: string(name='Duration', description='The duration.', example='3.227574'),
            index?: string(name='Index', description='The sequence number of the audio stream. The value indicates the position of the audio stream in all audio streams.', example='0'),
            lang?: string(name='Lang', description='The language.', example='und'),
            numFrames?: string(name='NumFrames', description='The total number of frames.', example='1'),
            sampleFmt?: string(name='SampleFmt', description='The sampling format.', example='fltp'),
            sampleRate?: string(name='SampleRate', description='The sampling rate.', example='44100'),
            startTime?: string(name='StartTime', description='The start time. The time follows the ISO 8601 standard in the yyyy-MM-ddTHH:mm:ssZ format. The time is displayed in UTC.', example='2017-01-11T12:00:00Z'),
            timebase?: string(name='Timebase', description='The time base.', example='0.000000'),
          }
        ](name='AudioStreamList', description='The information about the audio stream.'),
        bitrate?: string(name='Bitrate', description='The bitrate of the file. Unit: Kbit/s.', example='771.2280'),
        creationTime?: string(name='CreationTime', description='The time when the source file was created. The time follows the ISO 8601 standard in the yyyy-MM-ddTHH:mm:ssZ format. The time is displayed in UTC.', example='2017-11-14T09:15:50Z'),
        duration?: string(name='Duration', description='The duration of the file. Unit: seconds.', example='42.4930'),
        fileName?: string(name='FileName', description='The name of the file.', example='27ffc438-164h67f57ef-0005-6884-51a-1****.mp4'),
        fileURL?: string(name='FileURL', description='The OSS URL of the source file.', example='http://example-bucket-****.oss-cn-shanghai.aliyuncs.com/27ffc438-164h67f57ef-0005-6884-51a-1****.mp4'),
        fps?: string(name='Fps', description='The frame rate of the file.', example='25.0000'),
        height?: long(name='Height', description='The height of the file. Unit: pixels.', example='540'),
        mediaId?: string(name='MediaId', description='The ID of the media asset.', example='1f1a6fc03ca04814031b8a6559e****'),
        size?: long(name='Size', description='The size of the file. Unit: bytes.', example='4096477'),
        status?: string(name='Status', description='The state of the file. Valid values:

*   **Uploading**: The file is being uploaded. This is the initial status.
*   **Normal**: The file is uploaded.
*   **UploadFail**: The file failed to be uploaded.
*   **Deleted**: The file is deleted.', example='Normal'),
        videoStreamList?: [ 
          {
            avgFPS?: string(name='AvgFPS', description='The average frame rate.', example='30.0'),
            bitrate?: string(name='Bitrate', description='The bitrate of the file. Unit: Kbit/s.', example='500'),
            codecLongName?: string(name='CodecLongName', description='The full name of the encoding format.', example='H.264 / AVC / MPEG-4 AVC / MPEG-4 part 10'),
            codecName?: string(name='CodecName', description='The short name of the encoding format.', example='h264'),
            codecTag?: string(name='CodecTag', description='The tag of the encoding format.', example='0x31637661'),
            codecTagString?: string(name='CodecTagString', description='The tag string of the encoding format.', example='avc1'),
            codecTimeBase?: string(name='CodecTimeBase', description='The time base of the encoder.', example='1/60'),
            dar?: string(name='Dar', description='The display aspect ratio (DAR).', example='0:1'),
            duration?: string(name='Duration', description='The duration.', example='3.166667'),
            fps?: string(name='Fps', description='The frame rate of the output file.', example='30.0'),
            HDRType?: string(name='HDRType', description='The HDR type of the video stream.', example='HDR'),
            hasBFrames?: string(name='HasBFrames', description='Indicates whether the video stream contains bidirectional frames (B-frames).', example='0'),
            height?: string(name='Height', description='The height of the video stream.', example='320'),
            index?: string(name='Index', description='The sequence number of the video stream. The value identifies the position of the video stream in all video streams.', example='1'),
            lang?: string(name='Lang', description='The language.', example='und'),
            level?: string(name='Level', description='The codec level.', example='30'),
            numFrames?: string(name='NumFrames', description='The total number of frames.', example='0'),
            pixFmt?: string(name='PixFmt', description='The pixel format of the video stream.', example='yuv420p'),
            profile?: string(name='Profile', description='The codec profile.', example='Main'),
            rotate?: string(name='Rotate', description='The rotation angle of the video. Valid values: [0,360).', example='90'),
            sar?: string(name='Sar', description='The sample aspect ratio (SAR).', example='0:1'),
            startTime?: string(name='StartTime', description='The start time. The time follows the ISO 8601 standard in the yyyy-MM-ddTHH:mm:ssZ format. The time is displayed in UTC.', example='2017-01-11T12:00:00Z'),
            timebase?: string(name='Timebase', description='The time base.', example='0.000000'),
            width?: string(name='Width', description='The horizontal resolution of the video.', example='568'),
          }
        ](name='VideoStreamList', description='The information about the video streams.'),
        width?: long(name='Width', description='The width of the file. Unit: pixels.', example='960'),
      }(name='MezzanineInfo', description='The source file information.'),
      playInfoList?: [ 
        {
          bitDepth?: int32(name='BitDepth', description='The color depth. This value is an integer.', example='8'),
          bitrate?: string(name='Bitrate', description='The bitrate of the media stream. Unit: Kbit/s.', example='450.878'),
          codecName?: string(name='CodecName', description='The short name of the codec.', example='h264'),
          creationTime?: string(name='CreationTime', description='The creation time. The time follows the ISO 8601 standard in the yyyy-MM-ddTHH:mm:ssZ format. The time is displayed in UTC.', example='2022-04-18T07:37:15Z'),
          definition?: string(name='Definition', description='The quality of the video stream. Valid values:

*   **FD**: low definition
*   **LD**: standard definition
*   **SD**: high definition
*   **HD**: ultra-high definition
*   **OD**: original definition
*   **2K**
*   **4K**
*   **SQ**: standard sound quality
*   **HQ**: high sound quality
*   **AUTO**: adaptive bitrate', example='LD'),
          duration?: string(name='Duration', description='The duration of the media stream. Unit: seconds.', example='9.0464'),
          encrypt?: long(name='Encrypt', description='Indicates whether the media stream was encrypted. Valid values:

*   **0**: The media stream is not encrypted.
*   **1**: The media stream is encrypted.', example='1'),
          encryptMode?: string(name='EncryptMode', description='The encryption type of the media stream. Valid values:

*   **License**: decryption on local devices.

>  If the encryption type is **License**, only ApsaraVideo Player SDK can be used to play videos.', example='License'),
          encryptType?: string(name='EncryptType', description='The encryption type of the media stream. Valid values:

*   **AliyunVoDEncryption**: Alibaba Cloud proprietary cryptography
*   **HLSEncryption**: HTTP Live Streaming (HLS) encryption

>  If the encryption type is AliyunVoDEncryption, only ApsaraVideo Player SDK can be used to play videos.', example='AliyunVoDEncryption'),
          format?: string(name='Format', description='The format of the media stream.

*   If the media file is a video file, the valid values are **mp4** and **m3u8**.
*   If the media asset is an audio-only file, the value is **mp3**.', example='m3u8'),
          fps?: string(name='Fps', description='The frame rate of the media stream. Unit: frames per second (FPS).', example='25'),
          HDRType?: string(name='HDRType', description='The HDR type of the media stream. Valid values:

*   HDR
*   HDR10
*   HLG
*   DolbyVision
*   HDRVivid
*   SDR+', example='HLG'),
          height?: long(name='Height', description='The height of the media stream. Unit: pixels.', example='640'),
          jobExt?: string(name='JobExt', description='The custom watermark information of the copyright watermark. This parameter is returned if you set `JobType` to `2`.', example='CopyrightMarkTest'),
          jobId?: string(name='JobId', description='The job ID for transcoding the media stream. This ID uniquely identifies a media stream.', example='80e9c6580e754a798c3c19c59b16****'),
          jobType?: int32(name='JobType', description='The type of the digital watermark. Valid values:

*   **1**: user-tracing watermark
*   **2**: copyright watermark', example='2'),
          modificationTime?: string(name='ModificationTime', description='The update time. The time follows the ISO 8601 standard in the yyyy-MM-ddTHH:mm:ssZ format. The time is displayed in UTC.', example='2022-04-20T06:32:19Z'),
          narrowBandType?: string(name='NarrowBandType', description='The transcoding type. Valid values:

*   **0**: regular transcoding
*   **1.0**: Narrowband HD™ 1.0 transcoding
*   **2.0**: Narrowband HD™ 2.0 transcoding', example='0'),
          playURL?: string(name='PlayURL', description='The playback URL of the video stream.'),
          size?: long(name='Size', description='The size of the media stream. Unit: bytes.', example='418112'),
          specification?: string(name='Specification', description='The specifications of transcoded audio and video streams. For more information about the valid values, see [Output specifications](~~124671#section-6bv-l0g-opq~~).', example='H264.LD'),
          status?: string(name='Status', description='The status of the audio or video stream. Valid values:

*   **Normal**: The latest transcoded stream in each quality and format is in the Normal status.
*   **Invisible**: If multiple streams are transcoded in the same quality and format, the latest transcoded stream is in the Normal status and other streams are in the Invisible status.', example='Normal'),
          streamType?: string(name='StreamType', description='The type of the media stream. If the media stream is a video stream, the value is **video**. If the media stream is an audio-only stream, the value is **audio**.', example='video'),
          templateGroupId?: string(name='TemplateGroupId', description='The ID of the transcoding template group.', example='fb0716154b21a4ecb5b70a26ccc8****'),
          templateId?: string(name='TemplateId', description='The ID of the transcoding template.', example='a86a4338dd2e83da45154004a541****'),
          watermarkId?: string(name='WatermarkId', description='The ID of the watermark that is associated with the media stream.', example='dgfn26457856****'),
          width?: long(name='Width', description='The width of the media stream. Unit: pixels.', example='360'),
        }
      ](name='PlayInfoList', description='The information about the audio or video stream.'),
    }
  ](name='MediaInfos', description='Details about media assets.'),
  nonExistMediaIds?: [ string ](name='NonExistMediaIds', description='The IDs of the media assets that do not exist.'),
  requestId?: string(name='RequestId', description='The request ID.', example='9E290613-04F4-47F4-795D30732077****'),
}

model BatchGetMediaInfosResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: BatchGetMediaInfosResponseBody(name='body'),
}

/**
 * @summary Obtains the basic information and source file information of multiple media assets.
 *
 * @description *   You can specify up to 20 audio or video file IDs in each request.
 * *   After a media file is uploaded, ApsaraVideo VOD processes the source file. Then, information about the media file is asynchronously generated. You can configure notifications for the [VideoAnalysisComplete](https://help.aliyun.com/document_detail/99935.html) event and call this operation to query information about a media file after you receive notifications for the [VideoAnalysisComplete](https://help.aliyun.com/document_detail/99935.html) event. For more information, see [Overview](https://help.aliyun.com/document_detail/55627.html).
 *
 * @param request BatchGetMediaInfosRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return BatchGetMediaInfosResponse
 */
async function batchGetMediaInfosWithOptions(request: BatchGetMediaInfosRequest, runtime: $RuntimeOptions): BatchGetMediaInfosResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.mediaIds)) {
    query['MediaIds'] = request.mediaIds;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'BatchGetMediaInfos',
    version = '2017-03-21',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Obtains the basic information and source file information of multiple media assets.
 *
 * @description *   You can specify up to 20 audio or video file IDs in each request.
 * *   After a media file is uploaded, ApsaraVideo VOD processes the source file. Then, information about the media file is asynchronously generated. You can configure notifications for the [VideoAnalysisComplete](https://help.aliyun.com/document_detail/99935.html) event and call this operation to query information about a media file after you receive notifications for the [VideoAnalysisComplete](https://help.aliyun.com/document_detail/99935.html) event. For more information, see [Overview](https://help.aliyun.com/document_detail/55627.html).
 *
 * @param request BatchGetMediaInfosRequest
 * @return BatchGetMediaInfosResponse
 */
async function batchGetMediaInfos(request: BatchGetMediaInfosRequest): BatchGetMediaInfosResponse {
  var runtime = new $RuntimeOptions{};
  return batchGetMediaInfosWithOptions(request, runtime);
}

model BatchSetVodDomainConfigsRequest {
  domainNames?: string(name='DomainNames', description='The domain name for CDN. Separate multiple domain names with commas (,).

This parameter is required.', example='example.com'),
  functions?: string(name='Functions', description='The features to configure.

*   Set this parameter in the following format: `[{"functionArgs":[{"argName":"domain_name","argValue":"www.example.com"}],"functionName":"set_req_host_header"}]`.
*   Specific features, such as filetype_based_ttl_set, support more than one configuration record. To update one of the configuration records, use the configId field to specify the record. `[{"functionArgs":[{"argName":"file_type","argValue":"jpg"},{"argName":"ttl","argValue":"18"},{"argName":"weight","argValue":"30"}],"functionName":"filetype_based_ttl_set","configId":5068995}]`
*   For more information, see the **Feature description** section.

This parameter is required.', example='[{"functionArgs":[{"argName":"domain_name","argValue":"www.example.com"}],"functionName":"set_req_host_header"}]'),
  ownerAccount?: string(name='OwnerAccount'),
  ownerId?: long(name='OwnerId'),
  securityToken?: string(name='SecurityToken'),
}

model BatchSetVodDomainConfigsResponseBody = {
  requestId?: string(name='RequestId', description='The ID of the request.', example='04F0F334-1335-436C-****-6C044FE73368'),
}

model BatchSetVodDomainConfigsResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: BatchSetVodDomainConfigsResponseBody(name='body'),
}

/**
 * @summary Configures one or more domain names for CDN.
 *
 * @description > This operation is available only in the **China (Shanghai)** region.
 *
 * @param request BatchSetVodDomainConfigsRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return BatchSetVodDomainConfigsResponse
 */
async function batchSetVodDomainConfigsWithOptions(request: BatchSetVodDomainConfigsRequest, runtime: $RuntimeOptions): BatchSetVodDomainConfigsResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.domainNames)) {
    query['DomainNames'] = request.domainNames;
  }
  if (!$isNull(request.functions)) {
    query['Functions'] = request.functions;
  }
  if (!$isNull(request.ownerAccount)) {
    query['OwnerAccount'] = request.ownerAccount;
  }
  if (!$isNull(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!$isNull(request.securityToken)) {
    query['SecurityToken'] = request.securityToken;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'BatchSetVodDomainConfigs',
    version = '2017-03-21',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Configures one or more domain names for CDN.
 *
 * @description > This operation is available only in the **China (Shanghai)** region.
 *
 * @param request BatchSetVodDomainConfigsRequest
 * @return BatchSetVodDomainConfigsResponse
 */
async function batchSetVodDomainConfigs(request: BatchSetVodDomainConfigsRequest): BatchSetVodDomainConfigsResponse {
  var runtime = new $RuntimeOptions{};
  return batchSetVodDomainConfigsWithOptions(request, runtime);
}

model BatchStartVodDomainRequest {
  domainNames?: string(name='DomainNames', description='The accelerated domain name. Separate multiple domain names with commas (,).

This parameter is required.', example='example.com'),
  ownerId?: long(name='OwnerId'),
  securityToken?: string(name='SecurityToken'),
}

model BatchStartVodDomainResponseBody = {
  requestId?: string(name='RequestId', description='The ID of the request.', example='15C66C7B-671A-4297-****-2C4477247A74'),
}

model BatchStartVodDomainResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: BatchStartVodDomainResponseBody(name='body'),
}

/**
 * @summary Enables accelerated domain names that are in the disabled state.
 *
 * @description *   This operation is available only in the **China (Shanghai)** region.
 * *   If the domain name that you want to enable is invalid or your Alibaba Cloud account has overdue payments, you cannot call this operation to enable the domain name.
 *
 * @param request BatchStartVodDomainRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return BatchStartVodDomainResponse
 */
async function batchStartVodDomainWithOptions(request: BatchStartVodDomainRequest, runtime: $RuntimeOptions): BatchStartVodDomainResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.domainNames)) {
    query['DomainNames'] = request.domainNames;
  }
  if (!$isNull(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!$isNull(request.securityToken)) {
    query['SecurityToken'] = request.securityToken;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'BatchStartVodDomain',
    version = '2017-03-21',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Enables accelerated domain names that are in the disabled state.
 *
 * @description *   This operation is available only in the **China (Shanghai)** region.
 * *   If the domain name that you want to enable is invalid or your Alibaba Cloud account has overdue payments, you cannot call this operation to enable the domain name.
 *
 * @param request BatchStartVodDomainRequest
 * @return BatchStartVodDomainResponse
 */
async function batchStartVodDomain(request: BatchStartVodDomainRequest): BatchStartVodDomainResponse {
  var runtime = new $RuntimeOptions{};
  return batchStartVodDomainWithOptions(request, runtime);
}

model BatchStopVodDomainRequest {
  domainNames?: string(name='DomainNames', description='The accelerated domain name. Separate multiple domain names with commas (,).

This parameter is required.', example='example.com'),
  ownerId?: long(name='OwnerId'),
  securityToken?: string(name='SecurityToken'),
}

model BatchStopVodDomainResponseBody = {
  requestId?: string(name='RequestId', description='The ID of the request.', example='15C66C7B-671A-4297-****-2C4477247A74'),
}

model BatchStopVodDomainResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: BatchStopVodDomainResponseBody(name='body'),
}

/**
 * @summary Disables accelerated domain names.
 *
 * @description *   This operation is available only in the **China (Shanghai)** region.
 * *   After you disable an accelerated domain name, the information about the domain name is retained. The system automatically reroutes all the requests that are destined for the domain name to the origin server.
 *
 * @param request BatchStopVodDomainRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return BatchStopVodDomainResponse
 */
async function batchStopVodDomainWithOptions(request: BatchStopVodDomainRequest, runtime: $RuntimeOptions): BatchStopVodDomainResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.domainNames)) {
    query['DomainNames'] = request.domainNames;
  }
  if (!$isNull(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!$isNull(request.securityToken)) {
    query['SecurityToken'] = request.securityToken;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'BatchStopVodDomain',
    version = '2017-03-21',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Disables accelerated domain names.
 *
 * @description *   This operation is available only in the **China (Shanghai)** region.
 * *   After you disable an accelerated domain name, the information about the domain name is retained. The system automatically reroutes all the requests that are destined for the domain name to the origin server.
 *
 * @param request BatchStopVodDomainRequest
 * @return BatchStopVodDomainResponse
 */
async function batchStopVodDomain(request: BatchStopVodDomainRequest): BatchStopVodDomainResponse {
  var runtime = new $RuntimeOptions{};
  return batchStopVodDomainWithOptions(request, runtime);
}

model CancelUrlUploadJobsRequest {
  jobIds?: string(name='JobIds', description='The IDs of the upload jobs. You can obtain the job IDs from PlayInfo in the response to the [GetPlayInfo](https://help.aliyun.com/document_detail/56124.html) operation.

*   You can specify a maximum of 10 IDs.
*   Separate multiple IDs with commas (,).

>  You must specify either JobIds or UploadUrls. If you specify both the JobIds and UploadUrls parameters, only the value of the JobIds parameter takes effect.', example='341c92e6c18dc435ee31253685****,0193d395194a83ad6ee2ef27a5b5****'),
  uploadUrls?: string(name='UploadUrls', description='The upload URLs of source video files. Separate multiple URLs with commas (,). You can specify a maximum of 10 URLs.

> *   You must encode the URLs before you use the URLs.
> *   You must specify either JobIds or UploadUrls. If you specify both the JobIds and UploadUrls parameters, only the value of the JobIds parameter takes effect.'),
}

model CancelUrlUploadJobsResponseBody = {
  canceledJobs?: [ string ](name='CanceledJobs', description='The IDs of canceled jobs.'),
  nonExists?: [ string ](name='NonExists', description='The jobs that do not exist.'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='25818875-5F78-4D5C-3C3D-D7393642****'),
}

model CancelUrlUploadJobsResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: CancelUrlUploadJobsResponseBody(name='body'),
}

/**
 * @summary Cancels URL-based upload jobs in the queue.
 *
 * @description *   You can cancel only URL-based upload jobs in the **Pending** state. You can query the status of a URL-based upload job by calling the [GetURLUploadInfos](https://help.aliyun.com/document_detail/106830.html) operation.
 * *   You cannot cancel an upload job that already starts.
 * *   You must specify either JobIds or UploadUrls. If you specify both parameters, only JobIds takes effect.
 *
 * @param request CancelUrlUploadJobsRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return CancelUrlUploadJobsResponse
 */
async function cancelUrlUploadJobsWithOptions(request: CancelUrlUploadJobsRequest, runtime: $RuntimeOptions): CancelUrlUploadJobsResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.jobIds)) {
    query['JobIds'] = request.jobIds;
  }
  if (!$isNull(request.uploadUrls)) {
    query['UploadUrls'] = request.uploadUrls;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'CancelUrlUploadJobs',
    version = '2017-03-21',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Cancels URL-based upload jobs in the queue.
 *
 * @description *   You can cancel only URL-based upload jobs in the **Pending** state. You can query the status of a URL-based upload job by calling the [GetURLUploadInfos](https://help.aliyun.com/document_detail/106830.html) operation.
 * *   You cannot cancel an upload job that already starts.
 * *   You must specify either JobIds or UploadUrls. If you specify both parameters, only JobIds takes effect.
 *
 * @param request CancelUrlUploadJobsRequest
 * @return CancelUrlUploadJobsResponse
 */
async function cancelUrlUploadJobs(request: CancelUrlUploadJobsRequest): CancelUrlUploadJobsResponse {
  var runtime = new $RuntimeOptions{};
  return cancelUrlUploadJobsWithOptions(request, runtime);
}

model ChangeResourceGroupRequest {
  resourceGroupId?: string(name='ResourceGroupId', description='The ID of the resource group.

This parameter is required.', example='rg-aekzko7fsuj****'),
  resourceId?: string(name='ResourceId', description='The ID of resource

This parameter is required.', example='app-xxxxxxx'),
  resourceRegionId?: string(name='ResourceRegionId', description='The ID of the region.

This parameter is required.', example='cn-shanghai'),
  resourceType?: string(name='ResourceType', description='The type of resource', example='AppInfo'),
}

model ChangeResourceGroupResponseBody = {
  requestId?: string(name='RequestId', description='Id of the request', example='25818875-5F78-4A*****F6-D7393642CA58'),
}

model ChangeResourceGroupResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ChangeResourceGroupResponseBody(name='body'),
}

/**
 * @summary Transfers a resource to a specified resource group.
 *
 * @param request ChangeResourceGroupRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ChangeResourceGroupResponse
 */
async function changeResourceGroupWithOptions(request: ChangeResourceGroupRequest, runtime: $RuntimeOptions): ChangeResourceGroupResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.resourceGroupId)) {
    query['ResourceGroupId'] = request.resourceGroupId;
  }
  if (!$isNull(request.resourceId)) {
    query['ResourceId'] = request.resourceId;
  }
  if (!$isNull(request.resourceRegionId)) {
    query['ResourceRegionId'] = request.resourceRegionId;
  }
  if (!$isNull(request.resourceType)) {
    query['ResourceType'] = request.resourceType;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'ChangeResourceGroup',
    version = '2017-03-21',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Transfers a resource to a specified resource group.
 *
 * @param request ChangeResourceGroupRequest
 * @return ChangeResourceGroupResponse
 */
async function changeResourceGroup(request: ChangeResourceGroupRequest): ChangeResourceGroupResponse {
  var runtime = new $RuntimeOptions{};
  return changeResourceGroupWithOptions(request, runtime);
}

model CreateAppInfoRequest {
  appName?: string(name='AppName', description='The name of the application. The application name must be unique.

*   The name can contain letters, digits, periods (.), hyphens (-), and at signs (@). The name can be up to 128 characters in length.
*   The value must be encoded in UTF-8.

This parameter is required.', example='test'),
  description?: string(name='Description', description='The description of the application.

*   The description can contain up to 512 characters in length.
*   The value must be encoded in UTF-8.', example='myfirstapp'),
  resourceGroupId?: string(name='ResourceGroupId', description='The resource group ID.', example='rg-aekzko7fsuj****'),
}

model CreateAppInfoResponseBody = {
  appId?: string(name='AppId', description='The ID of the application.', example='app-****'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='25818875-5F78-4A13-34D5-D7393642****'),
}

model CreateAppInfoResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: CreateAppInfoResponseBody(name='body'),
}

/**
 * @summary Creates an application.
 *
 * @description You can create up to 10 applications within an Alibaba Cloud account. For more information, see [Multi-application service](https://help.aliyun.com/document_detail/113600.html).
 * ### QPS limits
 * You can call this operation up to 50 times per second per account. Requests that exceed this limit are dropped and you will experience service interruptions. We recommend that you take note of this limit when you call this operation. For more information, see [QPS limits on API operations in ApsaraVideo VOD](https://help.aliyun.com/document_detail/342790.html).
 *
 * @param request CreateAppInfoRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return CreateAppInfoResponse
 */
async function createAppInfoWithOptions(request: CreateAppInfoRequest, runtime: $RuntimeOptions): CreateAppInfoResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.appName)) {
    query['AppName'] = request.appName;
  }
  if (!$isNull(request.description)) {
    query['Description'] = request.description;
  }
  if (!$isNull(request.resourceGroupId)) {
    query['ResourceGroupId'] = request.resourceGroupId;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'CreateAppInfo',
    version = '2017-03-21',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Creates an application.
 *
 * @description You can create up to 10 applications within an Alibaba Cloud account. For more information, see [Multi-application service](https://help.aliyun.com/document_detail/113600.html).
 * ### QPS limits
 * You can call this operation up to 50 times per second per account. Requests that exceed this limit are dropped and you will experience service interruptions. We recommend that you take note of this limit when you call this operation. For more information, see [QPS limits on API operations in ApsaraVideo VOD](https://help.aliyun.com/document_detail/342790.html).
 *
 * @param request CreateAppInfoRequest
 * @return CreateAppInfoResponse
 */
async function createAppInfo(request: CreateAppInfoRequest): CreateAppInfoResponse {
  var runtime = new $RuntimeOptions{};
  return createAppInfoWithOptions(request, runtime);
}

model CreateAuditRequest {
  auditContent?: string(name='AuditContent', description='The review content. You can specify up to **100** audio or video files in a request. The value must be converted to a string.\\\\
For more information about this parameter, see the **AuditContent** section of this topic.

This parameter is required.', example='[{"VideoId":"93ab850b4f*****b54b6e91d24d81d4","Status":"Normal"},{"VideoId":"f867fbfb58*****8bbab65c4480ae1d","Status":"Blocked","Reason":"porn video","Comment":"porn video"}]'),
}

model CreateAuditResponseBody = {
  requestId?: string(name='RequestId', description='The ID of the request.', example='25818875-5F78-4A*****F6-D7393642CA58'),
}

model CreateAuditResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: CreateAuditResponseBody(name='body'),
}

/**
 * @summary Performs manual review on media files, such as audio and video files.
 *
 * @param request CreateAuditRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return CreateAuditResponse
 */
async function createAuditWithOptions(request: CreateAuditRequest, runtime: $RuntimeOptions): CreateAuditResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.auditContent)) {
    query['AuditContent'] = request.auditContent;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'CreateAudit',
    version = '2017-03-21',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Performs manual review on media files, such as audio and video files.
 *
 * @param request CreateAuditRequest
 * @return CreateAuditResponse
 */
async function createAudit(request: CreateAuditRequest): CreateAuditResponse {
  var runtime = new $RuntimeOptions{};
  return createAuditWithOptions(request, runtime);
}

model CreateUploadAttachedMediaRequest {
  appId?: string(name='AppId', description='The ID of the application. Default value: **app-1000000**. If you have activated the multi-application service, specify the ID of the application to add the watermark template in the specified application. For more information, see [Overview](https://help.aliyun.com/document_detail/113600.html).', example='app-****'),
  businessType?: string(name='BusinessType', description='The type of the auxiliary media asset. Valid values:

*   **watermark**
*   **subtitle**
*   **material**

This parameter is required.', example='watermark'),
  cateIds?: string(name='CateIds', description='The ID of the category. Separate multiple IDs with commas (,). You can specify up to five IDs. You can use one of the following methods to obtain the ID:

*   Log on to the [ApsaraVideo VOD console](https://vod.console.aliyun.com). In the left-side navigation pane, choose **Configuration Management** > **Media Management** > **Categories** to view the category ID of the media file.
*   Obtain the category ID from the response to the [AddCategory](~~AddCategory~~) operation that you call to create a category.
*   Obtain the category ID from the response to the [GetCategories](~~GetCategories~~) operation that you call to query categories.', example='1298****,0813****'),
  description?: string(name='Description', description='The description of the auxiliary media asset. Take note of the following items:

*   The description can be up to 1,024 bytes in length.
*   The value must be encoded in UTF-8.', example='uploadTest'),
  fileName?: string(name='FileName', description='The source file URL of the auxiliary media asset.

>  The file name extension is optional. If the file name extension that you specified for this parameter is different from the value of MediaExt, the value of MediaExt takes effect.', example='D:\\\\test.png'),
  fileSize?: string(name='FileSize', description='The size of the auxiliary media asset. Unit: byte.', example='123'),
  mediaExt?: string(name='MediaExt', description='The file name extension of the auxiliary media asset.

*   Valid values for watermarks: **png, gif, apng, and mov**
*   Valid values for subtitles: **srt, ass, stl, ttml, and vtt**
*   Valid values for materials: **jpg, gif, png, mp4, mat, zip, and apk**', example='png'),
  storageLocation?: string(name='StorageLocation', description='The storage address. Perform the following operations to obtain the storage address:

Log on to the [ApsaraVideo VOD console](https://vod.console.aliyun.com). In the left-side navigation pane, choose **Configuration Management** > **Media Management** > **Storage**. On the Storage page, view the storage address.

>  If you leave this parameter empty, the auxiliary media asset is uploaded to the default storage address. If you specify this parameter, the auxiliary media asset is uploaded to the specified storage address.', example='out-****.oss-cn-shanghai.aliyuncs.com'),
  tags?: string(name='Tags', description='The one or more tags of the auxiliary media asset. Take note of the following items:

*   You can specify a maximum of 16 tags.
*   If you need to specify multiple tags, separate the tags with commas (,).
*   Each tag can be up to 32 characters in length.
*   The value must be encoded in UTF-8.', example='tag1,tag2'),
  title?: string(name='Title', description='The title of the auxiliary media asset. The following rules apply:

*   The title cannot exceed 128 bytes.
*   The title must be encoded in UTF-8.', example='testTitle'),
  userData?: string(name='UserData', description='The custom configurations. For example, you can specify callback configurations and upload acceleration configurations. The value must be a JSON string. For more information, see [Request parameters](~~86952#section-6fg-qll-v3w~~).

> *   The callback configurations take effect only after you specify the HTTP callback URL and select the specific callback events in the ApsaraVideo VOD console. For more information about how to configure HTTP callback settings in the ApsaraVideo VOD console, see [Configure callback settings](https://help.aliyun.com/document_detail/86071.html).
> *   If you want to enable the upload acceleration feature, submit a ticket. For more information, see [Overview](https://help.aliyun.com/document_detail/55396.html). For more information about how to submit a ticket, see [Contact us](https://help.aliyun.com/document_detail/464625.html).', example='{"MessageCallback":{"CallbackURL":"http://example.aliyundoc.com"},"Extend":{"localId":"xxx","test":"www"}}'),
}

model CreateUploadAttachedMediaResponseBody = {
  fileURL?: string(name='FileURL', description='The URL of the auxiliary media asset file. The URL is an Object Storage Service (OSS) URL and does not contain the information used for URL signing.

You can use specify this value for the `FileUrl` parameter when you call the [AddWatermark](~~AddWatermark~~) operation to create a watermark template.', example='https://****.oss-cn-shanghai.aliyuncs.com/watermark/****.mov'),
  mediaId?: string(name='MediaId', description='The ID of the auxiliary media asset.', example='97dc17a5abc3668489b84ce9****'),
  mediaURL?: string(name='MediaURL', description='The URL of the auxiliary media asset.

If a domain name for Alibaba Cloud CDN is specified, a CDN URL is returned. Otherwise, an OSS URL is returned.

>  If you enable the URL signing feature of ApsaraVideo VOD, you may be unable to access the returned URL of the auxiliary media asset by using a browser and the HTTP status code 403 may be returned. To resolve this issue, you can disable the [URL signing](https://help.aliyun.com/document_detail/86090.html) feature or [generate a signed URL](https://help.aliyun.com/document_detail/57007.html).', example='http://example.aliyundoc.com/watermark/****.mov?auth_key=****'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='73254DE5-F260-4720-D06856B63C01****'),
  uploadAddress?: string(name='UploadAddress', description='The upload URL.

>  The upload URL returned by this operation is Base64-encoded. Before you can use an SDK or an API operation to upload a media asset based on the upload URL, you must decode the upload URL by using the Base64 algorithm. You must parse the upload URL only if you use native OSS SDKs or OSS API for uploads.', example='LWNuLXNoYW5naGFpLmFsaXl1b****'),
  uploadAuth?: string(name='UploadAuth', description='The upload credential.

>  The upload credential returned by this operation is Base64-encoded. Before you can use an SDK or an API operation to upload a media asset based on the upload credential, you must decode the upload credential by using the Base64 algorithm. You must parse the upload credential only if you use native OSS SDKs or OSS API for uploads.', example='UzFnUjFxNkZ0NUIZTaklyNWJoQ00zdHF****'),
}

model CreateUploadAttachedMediaResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: CreateUploadAttachedMediaResponseBody(name='body'),
}

/**
 * @summary Obtains an upload URL and an upload credential for an auxiliary media asset such as a watermark image, subtitle file, or material and generates the media ID. ApsaraVideo VOD issues upload URLs and credentials to perform authorization and ensure security. This prevents unauthorized users from uploading media files. ApsaraVideo VOD generates media IDs together with upload URLs and credentials. Media IDs are used in lifecycle management and media processing.
 *
 * @description *   **Make sure that you understand the billing method and prices of ApsaraVideo VOD before you call this operation. You are charged storage fees after you upload media files to ApsaraVideo VOD. For more information, see [Billing of media asset storage](~~188308#section_e97_xrp_mzz~~). If you have activated the acceleration service, you are charged acceleration fees when you upload media files to ApsaraVideo VOD. For more information, see [Billing of acceleration traffic](~~188310#section_sta_zm2_tsv~~).**
 * *   You can call this operation only to obtain the upload URLs and credentials for media files and create media assets in ApsaraVideo VOD. You cannot call this operation to upload media files. For more information about how to upload media files by calling API operations, see [Upload media files by calling API operations](https://help.aliyun.com/document_detail/476208.html).
 * *   If the upload credential expires after 3,000 seconds, you can call the CreateUploadAttachedMedia operation again to obtain a new upload URL and a new upload credential.
 * *   You can configure a callback to receive an [AttachedMediaUploadComplete](https://help.aliyun.com/document_detail/103250.html) event notification to determine whether the upload is successful.
 * *   You must obtain a URL and a credential before you upload a media file to ApsaraVideo VOD. ApsaraVideo VOD supports multiple upload methods. Each method has different requirements on upload URLs and credentials. For more information, see [Upload URLs and credentials](https://help.aliyun.com/document_detail/55397.html).
 *
 * @param request CreateUploadAttachedMediaRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return CreateUploadAttachedMediaResponse
 */
async function createUploadAttachedMediaWithOptions(request: CreateUploadAttachedMediaRequest, runtime: $RuntimeOptions): CreateUploadAttachedMediaResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.appId)) {
    query['AppId'] = request.appId;
  }
  if (!$isNull(request.businessType)) {
    query['BusinessType'] = request.businessType;
  }
  if (!$isNull(request.cateIds)) {
    query['CateIds'] = request.cateIds;
  }
  if (!$isNull(request.description)) {
    query['Description'] = request.description;
  }
  if (!$isNull(request.fileName)) {
    query['FileName'] = request.fileName;
  }
  if (!$isNull(request.fileSize)) {
    query['FileSize'] = request.fileSize;
  }
  if (!$isNull(request.mediaExt)) {
    query['MediaExt'] = request.mediaExt;
  }
  if (!$isNull(request.storageLocation)) {
    query['StorageLocation'] = request.storageLocation;
  }
  if (!$isNull(request.tags)) {
    query['Tags'] = request.tags;
  }
  if (!$isNull(request.title)) {
    query['Title'] = request.title;
  }
  if (!$isNull(request.userData)) {
    query['UserData'] = request.userData;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'CreateUploadAttachedMedia',
    version = '2017-03-21',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Obtains an upload URL and an upload credential for an auxiliary media asset such as a watermark image, subtitle file, or material and generates the media ID. ApsaraVideo VOD issues upload URLs and credentials to perform authorization and ensure security. This prevents unauthorized users from uploading media files. ApsaraVideo VOD generates media IDs together with upload URLs and credentials. Media IDs are used in lifecycle management and media processing.
 *
 * @description *   **Make sure that you understand the billing method and prices of ApsaraVideo VOD before you call this operation. You are charged storage fees after you upload media files to ApsaraVideo VOD. For more information, see [Billing of media asset storage](~~188308#section_e97_xrp_mzz~~). If you have activated the acceleration service, you are charged acceleration fees when you upload media files to ApsaraVideo VOD. For more information, see [Billing of acceleration traffic](~~188310#section_sta_zm2_tsv~~).**
 * *   You can call this operation only to obtain the upload URLs and credentials for media files and create media assets in ApsaraVideo VOD. You cannot call this operation to upload media files. For more information about how to upload media files by calling API operations, see [Upload media files by calling API operations](https://help.aliyun.com/document_detail/476208.html).
 * *   If the upload credential expires after 3,000 seconds, you can call the CreateUploadAttachedMedia operation again to obtain a new upload URL and a new upload credential.
 * *   You can configure a callback to receive an [AttachedMediaUploadComplete](https://help.aliyun.com/document_detail/103250.html) event notification to determine whether the upload is successful.
 * *   You must obtain a URL and a credential before you upload a media file to ApsaraVideo VOD. ApsaraVideo VOD supports multiple upload methods. Each method has different requirements on upload URLs and credentials. For more information, see [Upload URLs and credentials](https://help.aliyun.com/document_detail/55397.html).
 *
 * @param request CreateUploadAttachedMediaRequest
 * @return CreateUploadAttachedMediaResponse
 */
async function createUploadAttachedMedia(request: CreateUploadAttachedMediaRequest): CreateUploadAttachedMediaResponse {
  var runtime = new $RuntimeOptions{};
  return createUploadAttachedMediaWithOptions(request, runtime);
}

model CreateUploadImageRequest {
  appId?: string(name='AppId', description='The ID of the application. Default value: **app-1000000**. For more information, see [Overview](https://help.aliyun.com/document_detail/113600.html).', example='app-1000000'),
  cateId?: long(name='CateId', description='The category ID of the image. You can use one of the following methods to obtain the category ID:

*   Log on to the [ApsaraVideo VOD console](https://vod.console.aliyun.com). In the left-side navigation pane, choose **Configuration Management** > **Media Management** > **Categories**. On the Categories page, you can view the category ID of the image.
*   Obtain the value of CateId from the response to the [AddCategory](https://help.aliyun.com/document_detail/56401.html) operation.
*   Obtain the value of CateId from the response to the [GetCategories](https://help.aliyun.com/document_detail/56406.html) operation.', example='100036****'),
  description?: string(name='Description', description='The description of the image.

*   The description can be up to 1,024 characters in length.
*   The value must be encoded in UTF-8.', example='The description of the image'),
  imageExt?: string(name='ImageExt', description='The file name extension of the image. Valid values:

*   **png** (default)
*   **jpg**
*   **jpeg**
*   **gif**', example='png'),
  imageType?: string(name='ImageType', description='The type of the image. Valid values:

*   **default**: the default image type.
*   **cover**: the thumbnail.

> You can manage only images of the **default** type in the ApsaraVideo VOD console.

This parameter is required.', example='default'),
  originalFileName?: string(name='OriginalFileName', description='The name of the source file.

> The name must contain a file name extension. The file name extension is not case-sensitive.', example='D:\\\\picture_01.png'),
  storageLocation?: string(name='StorageLocation', description='The storage address. Perform the following operations to obtain the storage address: Log on to the [ApsaraVideo VOD console](https://vod.console.aliyun.com). In the left-side navigation pane, choose **Configuration Management** > **Media Management** > **Storage**. On the Storage page, view the storage address.

> If you specify a storage address, media files are uploaded to the specified address.', example='outin-****..oss-cn-shanghai.aliyuncs.com'),
  tags?: string(name='Tags', description='The tags of the image. The following rules apply:

*   Each tag can be up to 32 characters in length.
*   You can specify a maximum of 16 tags for an image.
*   Separate multiple tags with commas (,).
*   The value must be encoded in UTF-8.', example='test'),
  title?: string(name='Title', description='The title of the image. The following rules apply:

*   The title can be up to 128 characters in length.
*   The value must be encoded in UTF-8.', example='mytitle'),
  userData?: string(name='UserData', description='The custom configurations, including callback configurations and upload acceleration configurations. The value must be a JSON string. For more information, see the "UserData: specifies the custom configurations for media upload" section of the [Request parameters](https://help.aliyun.com/document_detail/86952.html) topic.

> *   The callback configurations take effect only after you specify the HTTP callback URL and select specific callback events in the ApsaraVideo VOD console. For more information about how to configure HTTP callback settings in the ApsaraVideo VOD console, see [Configure callback settings](https://help.aliyun.com/document_detail/86071.html).
> *   If you want to enable the upload acceleration feature, submit a ticket. For more information, see [Overview](https://help.aliyun.com/document_detail/55396.html). For more information about how to submit a ticket, see [Contact us](https://help.aliyun.com/document_detail/464625.html).', example='{"MessageCallback":{"CallbackURL":"http://example.aliyundoc.com"},"Extend":{"localId":"xxx","test":"www"}}'),
}

model CreateUploadImageResponseBody = {
  fileURL?: string(name='FileURL', description='The OSS URL of the file. The URL does not contain the information used for URL signing. You can specify FileUrl when you call the [AddWatermark](https://help.aliyun.com/document_detail/98617.html) operation.', example='http://example.aliyundoc.com/cover/2017-34DB-4F4C-9373-003AA060****.png'),
  imageId?: string(name='ImageId', description='The ID of the image file.', example='93ab850b4f6f46e91d24d81d4****'),
  imageURL?: string(name='ImageURL', description='The URL of the image.

> If the returned URL is inaccessible from a browser and the HTTP 403 status code is returned, the URL signing feature in ApsaraVideo VOD is enabled. To resolve this issue, you can disable the [URL signing](https://help.aliyun.com/document_detail/86090.html) feature or [generate a signed URL](https://help.aliyun.com/document_detail/57007.html).', example='http://example.aliyundoc.com/cover/2017-34DB-4F4C-9373-003AA060****.png'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='25818875-5F78-AEF6-D7393642****'),
  uploadAddress?: string(name='UploadAddress', description='The upload URL.

> The returned upload URL is a Base64-encoded URL. You must decode the Base64-encoded URL before you use an SDK or call an API operation to upload auxiliary media assets. You need to parse UploadAddress only if you use the OSS SDK or call an OSS API operation to upload auxiliary media assets.', example='eyJTZWN1cmuIjoiQ0FJU3p3TjF****'),
  uploadAuth?: string(name='UploadAuth', description='The upload credential.

> The returned upload credential is a Base64-encoded value. You must decode the Base64-encoded credential before you use an SDK or call an API operation to upload auxiliary media assets. You need to parse UploadAuth only if you use the OSS SDK or call an OSS API operation to upload auxiliary media assets.', example='eyJFbmmRCI6Im****'),
}

model CreateUploadImageResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: CreateUploadImageResponseBody(name='body'),
}

/**
 * @summary Queries a URL and a credential for uploading an image.
 *
 * @description *   **Make sure that you understand the billing method and price of ApsaraVideo VOD before you call this operation. You are charged storage fees after you upload media files to ApsaraVideo VOD. For more information, see [Billing of media asset storage](~~188308#section_e97_xrp_mzz~~). If you have activated the acceleration service, you are charged acceleration fees when you upload media files to ApsaraVideo VOD. For more information, see [Billing of acceleration traffic](~~188310#section_sta_zm2_tsv~~).**
 * *   You must obtain a URL and a credential before you upload an image to ApsaraVideo VOD. ApsaraVideo VOD provides multiple upload methods. You can upload files by using server upload SDKs, client upload SDKs, URLs, Object Storage Service (OSS) API, or OSS SDKs. Each upload method has different requirements for obtaining upload URLs and credentials. For more information, see the "Usage notes" section of the [Upload URLs and credentials](https://help.aliyun.com/document_detail/55397.html) topic.
 * *   You cannot refresh the upload URL or credential when you upload images. If the image upload credential expires, you can call this operation to obtain a new upload URL and credential. By default, the validity period of an image upload credential is 3,000 seconds.
 * *   You can call the [CreateUploadAttachedMedia](https://help.aliyun.com/document_detail/98467.html) operation to upload image watermarks.
 * *   You can configure a callback for [ImageUploadComplete](https://help.aliyun.com/document_detail/91968.html) to receive notifications about the image upload status.
 *
 * @param request CreateUploadImageRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return CreateUploadImageResponse
 */
async function createUploadImageWithOptions(request: CreateUploadImageRequest, runtime: $RuntimeOptions): CreateUploadImageResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.appId)) {
    query['AppId'] = request.appId;
  }
  if (!$isNull(request.cateId)) {
    query['CateId'] = request.cateId;
  }
  if (!$isNull(request.description)) {
    query['Description'] = request.description;
  }
  if (!$isNull(request.imageExt)) {
    query['ImageExt'] = request.imageExt;
  }
  if (!$isNull(request.imageType)) {
    query['ImageType'] = request.imageType;
  }
  if (!$isNull(request.originalFileName)) {
    query['OriginalFileName'] = request.originalFileName;
  }
  if (!$isNull(request.storageLocation)) {
    query['StorageLocation'] = request.storageLocation;
  }
  if (!$isNull(request.tags)) {
    query['Tags'] = request.tags;
  }
  if (!$isNull(request.title)) {
    query['Title'] = request.title;
  }
  if (!$isNull(request.userData)) {
    query['UserData'] = request.userData;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'CreateUploadImage',
    version = '2017-03-21',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Queries a URL and a credential for uploading an image.
 *
 * @description *   **Make sure that you understand the billing method and price of ApsaraVideo VOD before you call this operation. You are charged storage fees after you upload media files to ApsaraVideo VOD. For more information, see [Billing of media asset storage](~~188308#section_e97_xrp_mzz~~). If you have activated the acceleration service, you are charged acceleration fees when you upload media files to ApsaraVideo VOD. For more information, see [Billing of acceleration traffic](~~188310#section_sta_zm2_tsv~~).**
 * *   You must obtain a URL and a credential before you upload an image to ApsaraVideo VOD. ApsaraVideo VOD provides multiple upload methods. You can upload files by using server upload SDKs, client upload SDKs, URLs, Object Storage Service (OSS) API, or OSS SDKs. Each upload method has different requirements for obtaining upload URLs and credentials. For more information, see the "Usage notes" section of the [Upload URLs and credentials](https://help.aliyun.com/document_detail/55397.html) topic.
 * *   You cannot refresh the upload URL or credential when you upload images. If the image upload credential expires, you can call this operation to obtain a new upload URL and credential. By default, the validity period of an image upload credential is 3,000 seconds.
 * *   You can call the [CreateUploadAttachedMedia](https://help.aliyun.com/document_detail/98467.html) operation to upload image watermarks.
 * *   You can configure a callback for [ImageUploadComplete](https://help.aliyun.com/document_detail/91968.html) to receive notifications about the image upload status.
 *
 * @param request CreateUploadImageRequest
 * @return CreateUploadImageResponse
 */
async function createUploadImage(request: CreateUploadImageRequest): CreateUploadImageResponse {
  var runtime = new $RuntimeOptions{};
  return createUploadImageWithOptions(request, runtime);
}

model CreateUploadVideoRequest {
  appId?: string(name='AppId', description='The ID of the application. Default value: **app-1000000**. For more information, see [Overview](https://help.aliyun.com/document_detail/113600.html).', example='app-1000000'),
  cateId?: long(name='CateId', description='The ID of the category. You can use one of the following methods to obtain the ID:

*   Log on to the [ApsaraVideo VOD console](https://vod.console.aliyun.com). In the left-side navigation pane, choose **Configuration Management** > **Media Management** > **Categories** to view the category ID of the media file.
*   Obtain the value of CateId from the response to the [AddCategory](~~AddCategory~~) operation.
*   Obtain the value of CateId from the response to the [GetCategories](~~GetCategories~~) operation.', example='100036****'),
  coverURL?: string(name='CoverURL', description='The URL of the custom video thumbnail.', example='https://example.aliyundoc.com/image/D22F553TEST****.jpeg'),
  description?: string(name='Description', description='The description of the audio or video file.

*   The value can be up to 1,024 characters in length.
*   The value must be encoded in UTF-8.', example='UploadTest'),
  fileName?: string(name='FileName', description='The name of the source file.

*   The name must contain a file name extension, which is not case-sensitive.
*   For more information about file name extensions supported by ApsaraVideo VOD, see [Overview](https://help.aliyun.com/document_detail/55396.html).

This parameter is required.', example='D:\\\\video_01.mp4'),
  fileSize?: long(name='FileSize', description='The size of the source file. Unit: bytes.', example='123'),
  storageLocation?: string(name='StorageLocation', description='The storage address. Perform the following operations to obtain the storage address: Log on to the [ApsaraVideo VOD console](https://vod.console.aliyun.com). In the left-side navigation pane, choose **Configuration Management** > **Media Management** > **Storage**. On the Storage page, view the storage address.

>  If you leave this parameter empty, audio and video files are uploaded to the default storage address. If you specify a storage address, audio and video files are uploaded to the specified address.', example='out-****.oss-cn-shanghai.aliyuncs.com'),
  tags?: string(name='Tags', description='The tags of the audio or video file.

*   You can specify a maximum of 16 tags.
*   If you want to specify multiple tags, separate the tags with commas (,).
*   Each tag can be up to 32 characters in length.
*   The value must be encoded in UTF-8.', example='tag1,tag2'),
  templateGroupId?: string(name='TemplateGroupId', description='The ID of the transcoding template group. You can use one of the following methods to obtain the ID:

*   Log on to the ApsaraVideo VOD console. In the left-side navigation pane, choose Configuration Management > Media Processing > Transcoding Template Groups. On the Transcoding Template Groups page, you can view the ID of the transcoding template group.[](https://vod.console.aliyun.com)************
*   Obtain the value of the TranscodeTemplateGroupId parameter from the response to the [AddTranscodeTemplateGroup](https://help.aliyun.com/document_detail/102665.html) operation that you called to create a transcoding template group.
*   Obtain the value of the TranscodeTemplateGroupId parameter from the response to the [ListTranscodeTemplateGroup](https://help.aliyun.com/document_detail/102669.html) operation that you called to query transcoding template groups.

> *   If you specify both WorkflowId and TemplateGroupId, the value of the WorkflowId parameter takes effect.
> *   If this parameter is not specified, transcoding is performed based on the default transcoding template group. If the transcoding template group ID is specified, transcoding is performed based on the specified template group.
> *   If the **No Transcoding** template group is used, only the [FileUploadComplete](https://help.aliyun.com/document_detail/55630.html) event notification is returned after a video is uploaded. The [StreamTranscodeComplete](https://help.aliyun.com/document_detail/55636.html) event notification is not returned.
> *   If you use the **No Transcoding** template group to upload videos, only videos in the format of MP4, FLV, MP3, M3U8, or WebM can be played. Videos in other formats can only be stored in ApsaraVideo VOD. You can view the file name extension to obtain the video format. If you want to use ApsaraVideo Player, make sure that the version of the player is V3.1.0 or later.', example='405477f9e214d19ea2c7c854****'),
  title?: string(name='Title', description='The title of the audio or video file.

*   The title can be up to 128 characters in length.
*   The value must be encoded in UTF-8.

This parameter is required.', example='UploadTest'),
  userData?: string(name='UserData', description='The custom configurations such as callback configurations and upload acceleration configurations. The value must be a JSON string. For more information, see [Request parameters](https://help.aliyun.com/document_detail/86952.html).

> *   The callback configurations take effect only after you specify the HTTP callback URL and select specific callback events in the ApsaraVideo VOD console. For more information about how to configure HTTP callback settings in the ApsaraVideo VOD console, see [Configure callback settings](https://help.aliyun.com/document_detail/86071.html).
>*   If you want to enable the upload acceleration feature, [submit a request on Yida](https://yida.alibaba-inc.com/o/ticketapply). For more information, see [Overview](https://help.aliyun.com/document_detail/55396.html).', example='{"MessageCallback":{"CallbackURL":"http://example.aliyundoc.com"},"Extend":{"localId":"*****","test":"www"}}'),
  workflowId?: string(name='WorkflowId', description='The ID of the workflow. To view the ID of the workflow, log on to the [ApsaraVideo VOD console](https://vod.console.aliyun.com). In the left-side navigation pane, choose **Configuration Management** > **Media Processing** > **Workflows**.

> If you specify the WorkflowId and TemplateGroupId parameters, the value of the WorkflowId parameter takes effect. For more information, see [Workflows](https://help.aliyun.com/document_detail/115347.html).', example='613efff3887ec34af685714cc461****'),
}

model CreateUploadVideoResponseBody = {
  requestId?: string(name='RequestId', description='The ID of the request.', example='25818875-5F78-4AF6-04D5-D7393642****'),
  uploadAddress?: string(name='UploadAddress', description='The upload URL.

> The returned upload URL is a Base64-encoded URL. You must decode the Base64-encoded URL before you use an SDK or call an API operation to upload media files. You need to parse UploadAddress only if you use the Object Storage Service (OSS) SDK or call an OSS API operation to upload media files.', example='eyJTZWN1cml0a2VuIjoiQ0FJU3p3TjF****'),
  uploadAuth?: string(name='UploadAuth', description='The upload credential.

> The returned upload credential is a Base64-encoded value. You must decode the Base64-encoded credential before you use an SDK or call an API operation to upload media files. You need to parse UploadAuth only if you use the OSS SDK or call an OSS API operation to upload media files.', example='eyJFbmRwb2ludCI6Imm****'),
  videoId?: string(name='VideoId', description='The ID of the audio or video file. VideoId can be used as a request parameter when you call an operation for media asset management, media processing, or media review.', example='93ab850b4f6f54b6e91d24d81d44****'),
}

model CreateUploadVideoResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: CreateUploadVideoResponseBody(name='body'),
}

/**
 * @summary Obtains an upload URL and an upload credential for uploading an audio or video file and generates the audio or video ID. ApsaraVideo VOD issues upload URLs and credentials to perform authorization and ensure security. This prevents unauthorized users from uploading media files. ApsaraVideo VOD generates media IDs, video IDs, and image IDs together with upload URLs and credentials. Media IDs are used in lifecycle management and media processing.
 *
 * @description *   **Make sure that you understand the billing method and prices of ApsaraVideo VOD before you call this operation. You are charged storage fees after you upload media files to ApsaraVideo VOD. For more information, see [Billing of media asset storage](~~188308#section_e97_xrp_mzz~~). If you have activated the acceleration service, you are charged acceleration fees when you upload media files to ApsaraVideo VOD. For more information, see [Billing of acceleration traffic](~~188310#section_sta_zm2_tsv~~).**
 * *   You can call this operation to obtain upload URLs and credentials for video and audio files. For more information, see [Upload URLs and credentials](https://help.aliyun.com/document_detail/55397.html).
 * *   You can call this operation only to obtain the upload URLs and credentials for media files and create media assets in ApsaraVideo VOD. You cannot call this operation to upload media files. For more information about how to upload media files by calling API operations, see [Upload media files by calling API operations](https://help.aliyun.com/document_detail/476208.html).
 * *   If the upload credential expires, call the [RefreshUploadVideo](~~RefreshUploadVideo~~) operation to obtain a new upload credential. The default validity period of an upload credential is 3,000 seconds.
 * *   You can configure a callback to receive an event notification when an audio or video file is uploaded. Alternatively, after you upload an audio or video file, you can call the [GetMezzanineInfo](https://help.aliyun.com/document_detail/59624.html) operation to determine whether the upload is successful. For more information, see [Overview](https://help.aliyun.com/document_detail/55396.html).
 * *   The value of the VideoId parameter that is returned after you call this operation can be used for media processing or the lifecycle management of media assets.
 * *   You must obtain a URL and a credential before you upload a media file to ApsaraVideo VOD. ApsaraVideo VOD supports multiple upload methods. Each method has different requirements on upload URLs and credentials. For more information, see [Upload URLs and credentials](https://help.aliyun.com/document_detail/55397.html).
 *
 * @param request CreateUploadVideoRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return CreateUploadVideoResponse
 */
async function createUploadVideoWithOptions(request: CreateUploadVideoRequest, runtime: $RuntimeOptions): CreateUploadVideoResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.appId)) {
    query['AppId'] = request.appId;
  }
  if (!$isNull(request.cateId)) {
    query['CateId'] = request.cateId;
  }
  if (!$isNull(request.coverURL)) {
    query['CoverURL'] = request.coverURL;
  }
  if (!$isNull(request.description)) {
    query['Description'] = request.description;
  }
  if (!$isNull(request.fileName)) {
    query['FileName'] = request.fileName;
  }
  if (!$isNull(request.fileSize)) {
    query['FileSize'] = request.fileSize;
  }
  if (!$isNull(request.storageLocation)) {
    query['StorageLocation'] = request.storageLocation;
  }
  if (!$isNull(request.tags)) {
    query['Tags'] = request.tags;
  }
  if (!$isNull(request.templateGroupId)) {
    query['TemplateGroupId'] = request.templateGroupId;
  }
  if (!$isNull(request.title)) {
    query['Title'] = request.title;
  }
  if (!$isNull(request.userData)) {
    query['UserData'] = request.userData;
  }
  if (!$isNull(request.workflowId)) {
    query['WorkflowId'] = request.workflowId;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'CreateUploadVideo',
    version = '2017-03-21',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Obtains an upload URL and an upload credential for uploading an audio or video file and generates the audio or video ID. ApsaraVideo VOD issues upload URLs and credentials to perform authorization and ensure security. This prevents unauthorized users from uploading media files. ApsaraVideo VOD generates media IDs, video IDs, and image IDs together with upload URLs and credentials. Media IDs are used in lifecycle management and media processing.
 *
 * @description *   **Make sure that you understand the billing method and prices of ApsaraVideo VOD before you call this operation. You are charged storage fees after you upload media files to ApsaraVideo VOD. For more information, see [Billing of media asset storage](~~188308#section_e97_xrp_mzz~~). If you have activated the acceleration service, you are charged acceleration fees when you upload media files to ApsaraVideo VOD. For more information, see [Billing of acceleration traffic](~~188310#section_sta_zm2_tsv~~).**
 * *   You can call this operation to obtain upload URLs and credentials for video and audio files. For more information, see [Upload URLs and credentials](https://help.aliyun.com/document_detail/55397.html).
 * *   You can call this operation only to obtain the upload URLs and credentials for media files and create media assets in ApsaraVideo VOD. You cannot call this operation to upload media files. For more information about how to upload media files by calling API operations, see [Upload media files by calling API operations](https://help.aliyun.com/document_detail/476208.html).
 * *   If the upload credential expires, call the [RefreshUploadVideo](~~RefreshUploadVideo~~) operation to obtain a new upload credential. The default validity period of an upload credential is 3,000 seconds.
 * *   You can configure a callback to receive an event notification when an audio or video file is uploaded. Alternatively, after you upload an audio or video file, you can call the [GetMezzanineInfo](https://help.aliyun.com/document_detail/59624.html) operation to determine whether the upload is successful. For more information, see [Overview](https://help.aliyun.com/document_detail/55396.html).
 * *   The value of the VideoId parameter that is returned after you call this operation can be used for media processing or the lifecycle management of media assets.
 * *   You must obtain a URL and a credential before you upload a media file to ApsaraVideo VOD. ApsaraVideo VOD supports multiple upload methods. Each method has different requirements on upload URLs and credentials. For more information, see [Upload URLs and credentials](https://help.aliyun.com/document_detail/55397.html).
 *
 * @param request CreateUploadVideoRequest
 * @return CreateUploadVideoResponse
 */
async function createUploadVideo(request: CreateUploadVideoRequest): CreateUploadVideoResponse {
  var runtime = new $RuntimeOptions{};
  return createUploadVideoWithOptions(request, runtime);
}

model DecryptKMSDataKeyRequest {
  cipherText?: string(name='CipherText', description='The ciphertext to be decrypted.

This parameter is required.', example='DZhOWVmZDktM2QxNi00ODk0LWJkNGYtMWZjNDNmM2YyYWJmaaSl+TztSIMe43nbTH/Z1Wr4XfLftKhAciUmDQXuMRl4WTvKhxjMThjK****'),
  ownerAccount?: string(name='OwnerAccount'),
  ownerId?: string(name='OwnerId'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: string(name='ResourceOwnerId'),
}

model DecryptKMSDataKeyResponseBody = {
  keyId?: string(name='KeyId', description='The ID of the customer master key (CMK) that was used to decrypt the ciphertext.', example='202b9877-5a25-46e3-a763-e20791b5****'),
  plaintext?: string(name='Plaintext', description='The plaintext that is generated after decryption.', example='tRYXuCwgja12xxO1N/gZERDDCLw9doZEQiPDk/Bv****'),
  requestId?: string(name='RequestId', description='The request ID.', example='25818875-5F78-4A*****F6-D7393642CA58'),
}

model DecryptKMSDataKeyResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DecryptKMSDataKeyResponseBody(name='body'),
}

/**
 * @summary Decrypts the ciphertext specified by CiphertextBlob in the Key Management Service (KMS) data key.
 *
 * @param request DecryptKMSDataKeyRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DecryptKMSDataKeyResponse
 */
async function decryptKMSDataKeyWithOptions(request: DecryptKMSDataKeyRequest, runtime: $RuntimeOptions): DecryptKMSDataKeyResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.cipherText)) {
    query['CipherText'] = request.cipherText;
  }
  if (!$isNull(request.ownerAccount)) {
    query['OwnerAccount'] = request.ownerAccount;
  }
  if (!$isNull(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!$isNull(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!$isNull(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'DecryptKMSDataKey',
    version = '2017-03-21',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Decrypts the ciphertext specified by CiphertextBlob in the Key Management Service (KMS) data key.
 *
 * @param request DecryptKMSDataKeyRequest
 * @return DecryptKMSDataKeyResponse
 */
async function decryptKMSDataKey(request: DecryptKMSDataKeyRequest): DecryptKMSDataKeyResponse {
  var runtime = new $RuntimeOptions{};
  return decryptKMSDataKeyWithOptions(request, runtime);
}

model DeleteAIImageInfosRequest {
  AIImageInfoIds?: string(name='AIImageInfoIds', description='The IDs of the images that are submitted for AI processing. You can obtain the value of AIImageInfoId from the response to the [ListAIImageInfo](~~ListAIImageInfo~~) operation.

- You can specify a maximum of 10 IDs.
- Separate multiple IDs with commas (,).

This parameter is required.', example='b89a6aabf144*****6197ebd6fe6cf29'),
}

model DeleteAIImageInfosResponseBody = {
  requestId?: string(name='RequestId', description='The ID of the request.', example='FCDC80EA-363C-41*****B8-0DF14033D643'),
}

model DeleteAIImageInfosResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DeleteAIImageInfosResponseBody(name='body'),
}

/**
 * @summary Deletes the information about one or more images that are submitted for AI processing.
 *
 * @description *   Regions that support this operation: **China (Beijing)** and **China (Shanghai)**.
 * *   This operation deletes only information about images that are submitted for AI processing. The image files are not deleted.
 *
 * @param request DeleteAIImageInfosRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DeleteAIImageInfosResponse
 */
async function deleteAIImageInfosWithOptions(request: DeleteAIImageInfosRequest, runtime: $RuntimeOptions): DeleteAIImageInfosResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.AIImageInfoIds)) {
    query['AIImageInfoIds'] = request.AIImageInfoIds;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'DeleteAIImageInfos',
    version = '2017-03-21',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Deletes the information about one or more images that are submitted for AI processing.
 *
 * @description *   Regions that support this operation: **China (Beijing)** and **China (Shanghai)**.
 * *   This operation deletes only information about images that are submitted for AI processing. The image files are not deleted.
 *
 * @param request DeleteAIImageInfosRequest
 * @return DeleteAIImageInfosResponse
 */
async function deleteAIImageInfos(request: DeleteAIImageInfosRequest): DeleteAIImageInfosResponse {
  var runtime = new $RuntimeOptions{};
  return deleteAIImageInfosWithOptions(request, runtime);
}

model DeleteAITemplateRequest {
  templateId?: string(name='TemplateId', description='The ID of the AI template. You can use one of the following methods to obtain the ID of the AI template:

*   Call the [AddAITemplate](https://help.aliyun.com/document_detail/102930.html) operation to add an AI template if no AI template exists. The value of TemplateId in the response is the ID of the AI template.
*   Call the [ListAITemplate](https://help.aliyun.com/document_detail/102936.html) operation if the template already exists. The value of TemplateId in the response is the ID of the AI template.

This parameter is required.', example='1706a0063dd733f6a823ef32e0a5****'),
}

model DeleteAITemplateResponseBody = {
  requestId?: string(name='RequestId', description='The request ID.', example='25818875-5F78-4A13-BEF6-****'),
  templateId?: string(name='TemplateId', description='The ID of the AI template.', example='1706a0063dd733f6a823ef32e0a5****'),
}

model DeleteAITemplateResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DeleteAITemplateResponseBody(name='body'),
}

/**
 * @summary Deletes an AI template.
 *
 * @description *   Regions that support this operation: **China (Beijing)**, **China (Shanghai)**, and **Singapore**.
 * *   You cannot delete an AI template that is set as the default template.
 *
 * @param request DeleteAITemplateRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DeleteAITemplateResponse
 */
async function deleteAITemplateWithOptions(request: DeleteAITemplateRequest, runtime: $RuntimeOptions): DeleteAITemplateResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.templateId)) {
    query['TemplateId'] = request.templateId;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'DeleteAITemplate',
    version = '2017-03-21',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Deletes an AI template.
 *
 * @description *   Regions that support this operation: **China (Beijing)**, **China (Shanghai)**, and **Singapore**.
 * *   You cannot delete an AI template that is set as the default template.
 *
 * @param request DeleteAITemplateRequest
 * @return DeleteAITemplateResponse
 */
async function deleteAITemplate(request: DeleteAITemplateRequest): DeleteAITemplateResponse {
  var runtime = new $RuntimeOptions{};
  return deleteAITemplateWithOptions(request, runtime);
}

model DeleteAppInfoRequest {
  appId?: string(name='AppId', description='The ID of the application. Default value: **app-1000000**. For more information, see [Overview](https://help.aliyun.com/document_detail/113600.html).

This parameter is required.', example='app-****'),
}

model DeleteAppInfoResponseBody = {
  requestId?: string(name='RequestId', description='The ID of the request.', example='25818875-5F78-4A13-BEF6-****'),
}

model DeleteAppInfoResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DeleteAppInfoResponseBody(name='body'),
}

/**
 * @summary Deletes an application.
 *
 * @description Application with resources can not be deleted.
 *
 * @param request DeleteAppInfoRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DeleteAppInfoResponse
 */
async function deleteAppInfoWithOptions(request: DeleteAppInfoRequest, runtime: $RuntimeOptions): DeleteAppInfoResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.appId)) {
    query['AppId'] = request.appId;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'DeleteAppInfo',
    version = '2017-03-21',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Deletes an application.
 *
 * @description Application with resources can not be deleted.
 *
 * @param request DeleteAppInfoRequest
 * @return DeleteAppInfoResponse
 */
async function deleteAppInfo(request: DeleteAppInfoRequest): DeleteAppInfoResponse {
  var runtime = new $RuntimeOptions{};
  return deleteAppInfoWithOptions(request, runtime);
}

model DeleteAttachedMediaRequest {
  mediaIds?: string(name='MediaIds', description='The ID of the auxiliary media asset that you want to delete.

*   Separate multiple IDs with commas (,). You can specify up to 20 IDs.
*   You can obtain the ID from the response to the [CreateUploadAttachedMedia](~~CreateUploadAttachedMedia~~) operation that you call to obtain the upload URL and credential.

This parameter is required.', example='8bc8e94fe4e55abde85718****,eb186180e989dd56****'),
}

model DeleteAttachedMediaResponseBody = {
  nonExistMediaIds?: [ string ](name='NonExistMediaIds', description='The IDs of the auxiliary media assets that failed to be deleted.'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='25818875-5F78-4AF6-D7393642CA58****'),
}

model DeleteAttachedMediaResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DeleteAttachedMediaResponseBody(name='body'),
}

/**
 * @summary Deletes auxiliary media assets from ApsaraVideo VOD. You can delete multiple auxiliary media assets such as watermark images, subtitle files, and materials in a batch.
 *
 * @description *   **This operation physically deletes auxiliary media assets. You cannot recover the auxiliary media assets that you deleted. Exercise caution when you call this operation.**
 * *   You can delete a maximum of 20 auxiliary media assets in one request.
 *
 * @param request DeleteAttachedMediaRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DeleteAttachedMediaResponse
 */
async function deleteAttachedMediaWithOptions(request: DeleteAttachedMediaRequest, runtime: $RuntimeOptions): DeleteAttachedMediaResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.mediaIds)) {
    query['MediaIds'] = request.mediaIds;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'DeleteAttachedMedia',
    version = '2017-03-21',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Deletes auxiliary media assets from ApsaraVideo VOD. You can delete multiple auxiliary media assets such as watermark images, subtitle files, and materials in a batch.
 *
 * @description *   **This operation physically deletes auxiliary media assets. You cannot recover the auxiliary media assets that you deleted. Exercise caution when you call this operation.**
 * *   You can delete a maximum of 20 auxiliary media assets in one request.
 *
 * @param request DeleteAttachedMediaRequest
 * @return DeleteAttachedMediaResponse
 */
async function deleteAttachedMedia(request: DeleteAttachedMediaRequest): DeleteAttachedMediaResponse {
  var runtime = new $RuntimeOptions{};
  return deleteAttachedMediaWithOptions(request, runtime);
}

model DeleteCategoryRequest {
  cateId?: long(name='CateId', description='The ID of the category. You can specify only one ID. You can use one of the following methods to obtain the ID:

*   Log on to the [ApsaraVideo VOD console](https://vod.console.aliyun.com). Choose **Configuration Management** > **Media Management** > **Categories**. On the Audio and Video / Image Category or Short Video Material Category tab, view the category ID.
*   Obtain the category ID from the response to the [AddCategory](~~AddCategory~~) operation.

>  If you specify the ID of a parent category, all subcategories under the parent category are deleted at the same time.

This parameter is required.', example='3300****'),
}

model DeleteCategoryResponseBody = {
  requestId?: string(name='RequestId', description='The ID of the request.', example='25818875-5F78-4AF6-D7393642CA58****'),
}

model DeleteCategoryResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DeleteCategoryResponseBody(name='body'),
}

/**
 * @summary Deletes a category and its subcategories.
 *
 * @description *   **After you call this operation to delete a category, all subcategories including level 2 and level 3 categories are deleted at the same time. Exercise caution when you call this operation.**
 * *   If you have classified specific media resources to a category, the category names labeled on these media resources are automatically deleted when you delete the category.
 *
 * @param request DeleteCategoryRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DeleteCategoryResponse
 */
async function deleteCategoryWithOptions(request: DeleteCategoryRequest, runtime: $RuntimeOptions): DeleteCategoryResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.cateId)) {
    query['CateId'] = request.cateId;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'DeleteCategory',
    version = '2017-03-21',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Deletes a category and its subcategories.
 *
 * @description *   **After you call this operation to delete a category, all subcategories including level 2 and level 3 categories are deleted at the same time. Exercise caution when you call this operation.**
 * *   If you have classified specific media resources to a category, the category names labeled on these media resources are automatically deleted when you delete the category.
 *
 * @param request DeleteCategoryRequest
 * @return DeleteCategoryResponse
 */
async function deleteCategory(request: DeleteCategoryRequest): DeleteCategoryResponse {
  var runtime = new $RuntimeOptions{};
  return deleteCategoryWithOptions(request, runtime);
}

model DeleteDynamicImageRequest {
  dynamicImageIds?: string(name='DynamicImageIds', description='The IDs of the animated stickers.

- Separate multiple IDs with commas (,). You can specify a maximum of 10 IDs.
- If you do not set this parameter, the system finds the video specified by the VideoId parameter and deletes the information about the animated stickers associated with the video. If more than 10 animated stickers are associated with the video specified by the VideoId parameter, the deletion request is denied.', example='beafec3834a4e52ea52042a4****,8281c8519847fd8970e79e80b6****'),
  videoId?: string(name='VideoId', description='The ID of the video associated with the animated stickers whose information you want to delete.

This parameter is required.', example='2321077d460b028700ef6c2f4d****'),
}

model DeleteDynamicImageResponseBody = {
  requestId?: string(name='RequestId', description='The ID of the request.', example='0C8F0FDD-A99F-4188-B41934C97A54****'),
}

model DeleteDynamicImageResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DeleteDynamicImageResponseBody(name='body'),
}

/**
 * @summary Deletes the information about animated stickers.
 *
 * @description > This operation deletes only the information about animated stickers, but not the animated stickers themselves.
 *
 * @param request DeleteDynamicImageRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DeleteDynamicImageResponse
 */
async function deleteDynamicImageWithOptions(request: DeleteDynamicImageRequest, runtime: $RuntimeOptions): DeleteDynamicImageResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.dynamicImageIds)) {
    query['DynamicImageIds'] = request.dynamicImageIds;
  }
  if (!$isNull(request.videoId)) {
    query['VideoId'] = request.videoId;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'DeleteDynamicImage',
    version = '2017-03-21',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Deletes the information about animated stickers.
 *
 * @description > This operation deletes only the information about animated stickers, but not the animated stickers themselves.
 *
 * @param request DeleteDynamicImageRequest
 * @return DeleteDynamicImageResponse
 */
async function deleteDynamicImage(request: DeleteDynamicImageRequest): DeleteDynamicImageResponse {
  var runtime = new $RuntimeOptions{};
  return deleteDynamicImageWithOptions(request, runtime);
}

model DeleteEditingProjectRequest {
  ownerAccount?: string(name='OwnerAccount'),
  ownerId?: string(name='OwnerId'),
  projectIds?: string(name='ProjectIds', description='The ID of the online editing project. Separate multiple IDs with commas (,).

This parameter is required.', example='fb2101bf24bf41*****cb318787dc'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: string(name='ResourceOwnerId'),
}

model DeleteEditingProjectResponseBody = {
  requestId?: string(name='RequestId', description='The ID of the request.', example='25818875-5F78-4A*****F6-D7393642CA58'),
}

model DeleteEditingProjectResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DeleteEditingProjectResponseBody(name='body'),
}

/**
 * @summary Deletes online editing projects.
 *
 * @description *   You can call this operation to delete multiple online editing projects at a time.
 *
 * @param request DeleteEditingProjectRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DeleteEditingProjectResponse
 */
async function deleteEditingProjectWithOptions(request: DeleteEditingProjectRequest, runtime: $RuntimeOptions): DeleteEditingProjectResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.ownerAccount)) {
    query['OwnerAccount'] = request.ownerAccount;
  }
  if (!$isNull(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!$isNull(request.projectIds)) {
    query['ProjectIds'] = request.projectIds;
  }
  if (!$isNull(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!$isNull(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'DeleteEditingProject',
    version = '2017-03-21',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Deletes online editing projects.
 *
 * @description *   You can call this operation to delete multiple online editing projects at a time.
 *
 * @param request DeleteEditingProjectRequest
 * @return DeleteEditingProjectResponse
 */
async function deleteEditingProject(request: DeleteEditingProjectRequest): DeleteEditingProjectResponse {
  var runtime = new $RuntimeOptions{};
  return deleteEditingProjectWithOptions(request, runtime);
}

model DeleteEditingProjectMaterialsRequest {
  materialIds?: string(name='MaterialIds', description='The material ID. Separate multiple material IDs with commas (,).

This parameter is required.', example='9e3101bf24bf41c*****123318788ca'),
  materialType?: string(name='MaterialType', description='The type of the material. Valid values:

*   **video**
*   **audio**
*   **image**

This parameter is required.', example='video'),
  ownerAccount?: string(name='OwnerAccount'),
  ownerId?: string(name='OwnerId'),
  projectId?: string(name='ProjectId', description='The ID of the online editing project.

This parameter is required.', example='198236101*****1093374'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: string(name='ResourceOwnerId'),
}

model DeleteEditingProjectMaterialsResponseBody = {
  requestId?: string(name='RequestId', description='The request ID.', example='746FFA07-8BBB-46*****B1-3E94E3B2915E'),
}

model DeleteEditingProjectMaterialsResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DeleteEditingProjectMaterialsResponseBody(name='body'),
}

/**
 * @summary 删除剪辑资源
 *
 * @param request DeleteEditingProjectMaterialsRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DeleteEditingProjectMaterialsResponse
 */
async function deleteEditingProjectMaterialsWithOptions(request: DeleteEditingProjectMaterialsRequest, runtime: $RuntimeOptions): DeleteEditingProjectMaterialsResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.materialIds)) {
    query['MaterialIds'] = request.materialIds;
  }
  if (!$isNull(request.materialType)) {
    query['MaterialType'] = request.materialType;
  }
  if (!$isNull(request.ownerAccount)) {
    query['OwnerAccount'] = request.ownerAccount;
  }
  if (!$isNull(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!$isNull(request.projectId)) {
    query['ProjectId'] = request.projectId;
  }
  if (!$isNull(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!$isNull(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'DeleteEditingProjectMaterials',
    version = '2017-03-21',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 删除剪辑资源
 *
 * @param request DeleteEditingProjectMaterialsRequest
 * @return DeleteEditingProjectMaterialsResponse
 */
async function deleteEditingProjectMaterials(request: DeleteEditingProjectMaterialsRequest): DeleteEditingProjectMaterialsResponse {
  var runtime = new $RuntimeOptions{};
  return deleteEditingProjectMaterialsWithOptions(request, runtime);
}

model DeleteImageRequest {
  deleteImageType?: string(name='DeleteImageType', description='The method that is used to delete images. Valid values:

*   **ImageURL**: deletes images based on URLs.
*   **ImageId**: deletes images based on image IDs.
*   **VideoId**: deletes images associated with a video based on the video ID.

This parameter is required.', example='VideoId'),
  imageIds?: string(name='ImageIds', description='The ID of the image. You can specify up to 20 image IDs and separate them with commas (,). You can use one of the following methods to obtain the image ID:

*   Log on to the [ApsaraVideo VOD console](https://vod.console.aliyun.com). In the left-side navigation pane, choose **Media Files** > **Image** to view the image ID.
*   Obtain the image ID from the response to the [CreateUploadImage](~~CreateUploadImage~~) operation that you call to obtain the upload credential and URL.
*   Obtain the image ID from the response to the [SearchMedia](~~SearchMedia~~) operation that you call to query images.

>  This parameter takes effect and is required only if you set **DeleteImageType** to **ImageId**.', example='bbc65bba53fed90de118a7849****,594228cdd14b4d069fc17a8c4a****'),
  imageType?: string(name='ImageType', description='The type of images that you want to delete. The images are associated with the video. Valid values:

*   **CoverSnapshot**: thumbnail snapshot.
*   **NormalSnapshot**: regular snapshot.
*   **SpriteSnapshot**: sprite snapshot.
*   **SpriteOriginSnapshot**: sprite source snapshot.
*   **All**: images of all the preceding types. You can specify multiple types other than `All` for this parameter. Separate multiple types with commas (,).

>  This parameter takes effect and is required only if you set **DeleteImageType** to **VideoId**.', example='All'),
  imageURLs?: string(name='ImageURLs', description='The URL of the image. You can obtain the value of `ImageURL` from the response to the [CreateUploadImage](~~CreateUploadImage~~) operation. You can specify up to 20 URLs and separate them with commas (,).

>  This parameter takes effect and is required only if you set **DeleteImageType** to **ImageURL**.', example='https://example.aliyundoc.com/image/default/41AE7ADABBE*****.png'),
  videoId?: string(name='VideoId', description='The ID of the video. You can specify only one ID. You can use one of the following methods to obtain the ID:

*   Log on to the [ApsaraVideo VOD console](https://vod.console.aliyun.com). In the left-side navigation pane, choose **Media Files** > **Audio/Video**. On the Video and Audio page, view the ID of the media file.
*   Obtain the video ID from the response to the [CreateUploadVideo](~~CreateUploadVideo~~) operation that you call to obtain the upload credential and URL.
*   Obtain the video ID from the response to the [SearchMedia](~~SearchMedia~~) operation that you call to query videos.

>  This parameter takes effect and is required only if you set **DeleteImageType** to **VideoId**.', example='eb1861d2c9a8842340e989dd56****'),
}

model DeleteImageResponseBody = {
  requestId?: string(name='RequestId', description='The ID of the request.', example='25818875-5F78-4AF6-D7393642CA58****'),
}

model DeleteImageResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DeleteImageResponseBody(name='body'),
}

/**
 * @summary Deletes uploaded images and video snapshots that are automatically captured.
 *
 * @description *   **After you call this operation to delete an image, the source file is permanently deleted and cannot be recovered. Exercise caution when you call this operation.**
 * *   If some images are cached on Alibaba Cloud CDN points of presence (POPs), the image URLs do not immediately become invalid.
 * *   You can call this operation to delete uploaded images and video snapshots.
 *
 * @param request DeleteImageRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DeleteImageResponse
 */
async function deleteImageWithOptions(request: DeleteImageRequest, runtime: $RuntimeOptions): DeleteImageResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.deleteImageType)) {
    query['DeleteImageType'] = request.deleteImageType;
  }
  if (!$isNull(request.imageIds)) {
    query['ImageIds'] = request.imageIds;
  }
  if (!$isNull(request.imageType)) {
    query['ImageType'] = request.imageType;
  }
  if (!$isNull(request.imageURLs)) {
    query['ImageURLs'] = request.imageURLs;
  }
  if (!$isNull(request.videoId)) {
    query['VideoId'] = request.videoId;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'DeleteImage',
    version = '2017-03-21',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Deletes uploaded images and video snapshots that are automatically captured.
 *
 * @description *   **After you call this operation to delete an image, the source file is permanently deleted and cannot be recovered. Exercise caution when you call this operation.**
 * *   If some images are cached on Alibaba Cloud CDN points of presence (POPs), the image URLs do not immediately become invalid.
 * *   You can call this operation to delete uploaded images and video snapshots.
 *
 * @param request DeleteImageRequest
 * @return DeleteImageResponse
 */
async function deleteImage(request: DeleteImageRequest): DeleteImageResponse {
  var runtime = new $RuntimeOptions{};
  return deleteImageWithOptions(request, runtime);
}

model DeleteMessageCallbackRequest {
  appId?: string(name='AppId', description='The ID of the application. If you do not set this parameter, the default value **app-1000000** is used.', example='app-1000000'),
  ownerAccount?: string(name='OwnerAccount'),
}

model DeleteMessageCallbackResponseBody = {
  requestId?: string(name='RequestId', description='The ID of the request.', example='25818875-5F78-4A13-****-D7393642CA58'),
}

model DeleteMessageCallbackResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DeleteMessageCallbackResponseBody(name='body'),
}

/**
 * @summary Deletes the callback method, callback URL, and event type of an event notification.
 *
 * @description > For more information, see [Overview](https://help.aliyun.com/document_detail/55627.html).
 *
 * @param request DeleteMessageCallbackRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DeleteMessageCallbackResponse
 */
async function deleteMessageCallbackWithOptions(request: DeleteMessageCallbackRequest, runtime: $RuntimeOptions): DeleteMessageCallbackResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.appId)) {
    query['AppId'] = request.appId;
  }
  if (!$isNull(request.ownerAccount)) {
    query['OwnerAccount'] = request.ownerAccount;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'DeleteMessageCallback',
    version = '2017-03-21',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Deletes the callback method, callback URL, and event type of an event notification.
 *
 * @description > For more information, see [Overview](https://help.aliyun.com/document_detail/55627.html).
 *
 * @param request DeleteMessageCallbackRequest
 * @return DeleteMessageCallbackResponse
 */
async function deleteMessageCallback(request: DeleteMessageCallbackRequest): DeleteMessageCallbackResponse {
  var runtime = new $RuntimeOptions{};
  return deleteMessageCallbackWithOptions(request, runtime);
}

model DeleteMezzaninesRequest {
  force?: boolean(name='Force', description='Specifies whether to forcibly delete the source file. Valid values:

*   **false** (default)
*   **true**

>  If a video is uploaded without transcoding or is asynchronously transcoded, the source file of the video is used for original-quality playback. By default, the source file of the video cannot be deleted. To forcibly delete the mezzanine file, set this parameter to **true**.', example='false'),
  videoIds?: string(name='VideoIds', description='The IDs of audio or video files whose source files that you want to delete. You can specify up to 20 IDs. Separate multiple IDs with commas (,). You can use one of the following methods to obtain the ID:

*   After you upload a video in the [ApsaraVideo VOD console](https://vod.console.aliyun.com), you can log on to the ApsaraVideo VOD console and choose **Media Files** > **Audio/Video** to view the ID of the video.
*   Obtain the value of VideoId from the response to the [CreateUploadVideo](https://help.aliyun.com/document_detail/55407.html) operation that you called to obtain the upload URL and credential.
*   Obtain the value of VideoId from the response to the [SearchMedia](https://help.aliyun.com/document_detail/86044.html) operation that you called to query media information after the audio or video file is uploaded.

This parameter is required.', example='23ab850b4f654b6e91d24d8157****,93ab850b4f6f4b6e91d24d81d4****'),
}

model DeleteMezzaninesResponseBody = {
  nonExistVideoIds?: [ string ](name='NonExistVideoIds', description='The IDs of the audio or video files that do not exist.'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='25818875-5F78-4AF6-D7393642CA58****'),
  unRemoveableVideoIds?: [ string ](name='UnRemoveableVideoIds', description='The IDs of the audio or video files whose source files cannot be deleted.

>  In most cases, source files cannot be deleted if they are used for original-quality playback or you do not have required permissions to delete them. For more information, see [Overview](https://help.aliyun.com/document_detail/113600.html).'),
}

model DeleteMezzaninesResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DeleteMezzaninesResponseBody(name='body'),
}

/**
 * @summary Deletes one or more source files at a time.
 *
 * @description All media processing operations in ApsaraVideo VOD, such as transcoding, snapshot capture, and content moderation, are performed based on source files. If you delete the source files, you cannot perform media processing operations. Exercise caution when you call this operation.
 *
 * @param request DeleteMezzaninesRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DeleteMezzaninesResponse
 */
async function deleteMezzaninesWithOptions(request: DeleteMezzaninesRequest, runtime: $RuntimeOptions): DeleteMezzaninesResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.force)) {
    query['Force'] = request.force;
  }
  if (!$isNull(request.videoIds)) {
    query['VideoIds'] = request.videoIds;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'DeleteMezzanines',
    version = '2017-03-21',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Deletes one or more source files at a time.
 *
 * @description All media processing operations in ApsaraVideo VOD, such as transcoding, snapshot capture, and content moderation, are performed based on source files. If you delete the source files, you cannot perform media processing operations. Exercise caution when you call this operation.
 *
 * @param request DeleteMezzaninesRequest
 * @return DeleteMezzaninesResponse
 */
async function deleteMezzanines(request: DeleteMezzaninesRequest): DeleteMezzaninesResponse {
  var runtime = new $RuntimeOptions{};
  return deleteMezzaninesWithOptions(request, runtime);
}

model DeleteMultipartUploadRequest {
  mediaId?: string(name='MediaId', description='The ID of the media file (VideoId). You can use one of the following methods to obtain the ID:

*   After you upload a video in the [ApsaraVideo VOD console](https://vod.console.aliyun.com), you can log on to the ApsaraVideo VOD console and choose **Media Files** > **Audio/Video** to view the ID of the video.
*   Obtain the value of VideoId from the response to the [CreateUploadVideo](https://help.aliyun.com/document_detail/55407.html) operation that you called to obtain the upload URL and credential.
*   Obtain the value of VideoId from the response to the [SearchMedia](https://help.aliyun.com/document_detail/86044.html) operation that you called to query media information after the audio or video file is uploaded.

This parameter is required.', example='61ccbdb06fa3012be4d8083f6****'),
  mediaType?: string(name='MediaType', description='The type of the media file. Set the value to **video**. video indicates audio and video files.

This parameter is required.', example='video'),
  ownerAccount?: string(name='OwnerAccount'),
}

model DeleteMultipartUploadResponseBody = {
  requestId?: string(name='RequestId', description='The ID of the request.', example='25818875-5F78-4AF6-D7393642CA58****'),
}

model DeleteMultipartUploadResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DeleteMultipartUploadResponseBody(name='body'),
}

/**
 * @summary Deletes the parts generated during an upload.
 *
 * @description *   During multipart upload, useless parts may be retained if the upload fails. These useless parts are automatically deleted after 7 days. You can call this operation to delete the generated parts after the upload is successful or fails.
 * *   This operation does not delete the source file or transcoded file, but deletes only the parts generated during the upload.
 * *   If you call the [DeleteVideo](https://help.aliyun.com/document_detail/52837.html) operation, the entire video file is deleted, including the generated parts.
 *
 * @param request DeleteMultipartUploadRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DeleteMultipartUploadResponse
 */
async function deleteMultipartUploadWithOptions(request: DeleteMultipartUploadRequest, runtime: $RuntimeOptions): DeleteMultipartUploadResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.mediaId)) {
    query['MediaId'] = request.mediaId;
  }
  if (!$isNull(request.mediaType)) {
    query['MediaType'] = request.mediaType;
  }
  if (!$isNull(request.ownerAccount)) {
    query['OwnerAccount'] = request.ownerAccount;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'DeleteMultipartUpload',
    version = '2017-03-21',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Deletes the parts generated during an upload.
 *
 * @description *   During multipart upload, useless parts may be retained if the upload fails. These useless parts are automatically deleted after 7 days. You can call this operation to delete the generated parts after the upload is successful or fails.
 * *   This operation does not delete the source file or transcoded file, but deletes only the parts generated during the upload.
 * *   If you call the [DeleteVideo](https://help.aliyun.com/document_detail/52837.html) operation, the entire video file is deleted, including the generated parts.
 *
 * @param request DeleteMultipartUploadRequest
 * @return DeleteMultipartUploadResponse
 */
async function deleteMultipartUpload(request: DeleteMultipartUploadRequest): DeleteMultipartUploadResponse {
  var runtime = new $RuntimeOptions{};
  return deleteMultipartUploadWithOptions(request, runtime);
}

model DeleteStreamRequest {
  jobIds?: string(name='JobIds', description='The job IDs for deleting media streams.

*   Separate multiple IDs with commas (,). A maximum of 20 IDs can be specified for one video.
*   You can obtain job IDs from the PlayInfo parameter that is returned after you call the [GetPlayInfo](https://help.aliyun.com/document_detail/56124.html) operation. Each media stream has a unique job ID.

This parameter is required.', example='35eb4dbda18c49cc0025df374b46****'),
  videoId?: string(name='VideoId', description='The ID of the video.

This parameter is required.', example='95948ddba24446b6aed5db985e78****'),
}

model DeleteStreamResponseBody = {
  requestId?: string(name='RequestId', description='The ID of the request.', example='25818875-5F78-4A7U43F6-D7393642****'),
}

model DeleteStreamResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DeleteStreamResponseBody(name='body'),
}

/**
 * @summary Deletes one or more video or audio streams and their storage files at a time.
 *
 * @param request DeleteStreamRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DeleteStreamResponse
 */
async function deleteStreamWithOptions(request: DeleteStreamRequest, runtime: $RuntimeOptions): DeleteStreamResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.jobIds)) {
    query['JobIds'] = request.jobIds;
  }
  if (!$isNull(request.videoId)) {
    query['VideoId'] = request.videoId;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'DeleteStream',
    version = '2017-03-21',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Deletes one or more video or audio streams and their storage files at a time.
 *
 * @param request DeleteStreamRequest
 * @return DeleteStreamResponse
 */
async function deleteStream(request: DeleteStreamRequest): DeleteStreamResponse {
  var runtime = new $RuntimeOptions{};
  return deleteStreamWithOptions(request, runtime);
}

model DeleteTranscodeTemplateGroupRequest {
  forceDelGroup?: string(name='ForceDelGroup', description='Specifies whether to forcibly delete the transcoding template group. Valid values:

*   **true**: deletes the transcoding template group and all the transcoding templates in the group.
*   **false** (default): deletes only the specified transcoding templates from the transcoding template group.', example='true'),
  transcodeTemplateGroupId?: string(name='TranscodeTemplateGroupId', description='The ID of the transcoding template group.

This parameter is required.', example='4c71a339fec*****152b4fa6f4527'),
  transcodeTemplateIds?: string(name='TranscodeTemplateIds', description='The IDs of the transcoding templates that you want to delete.

*   Separate multiple IDs with commas (,).
*   You can specify a maximum of 10 IDs.
*   This parameter is required if you set ForceDelGroup to false or leave ForceDelGroup empty.', example='["613702defdc4*****6a3b94cace1129e","bfd6c90253a2*****7fc054d7c5825"]'),
}

model DeleteTranscodeTemplateGroupResponseBody = {
  nonExistTranscodeTemplateIds?: [ string ](name='NonExistTranscodeTemplateIds', description='The IDs of transcoding templates that were not found.'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='25818875-5F78-4A*****F6-D7393642CA58'),
}

model DeleteTranscodeTemplateGroupResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DeleteTranscodeTemplateGroupResponseBody(name='body'),
}

/**
 * @summary Deletes one or more transcoding templates from a transcoding template group or forcibly deletes a transcoding template group.
 *
 * @description *   You cannot call this operation to delete the default transcoding template. You can delete the transcoding template when it is no longer specified as the default one.
 * *   For security purposes, you cannot add, modify, or delete transcoding templates in a transcoding template group that is locked. To check whether a transcoding template group is locked, call the [GetTranscodeTemplateGroup](~~GetTranscodeTemplateGroup~~) operation and obtain the Locked parameter from the response. To modify transcoding templates within a locked transcoding template group, you must call the [UpdateTranscodeTemplateGroup](~~UpdateTranscodeTemplateGroup~~) operation to unlock the transcoding template group first.
 *
 * @param request DeleteTranscodeTemplateGroupRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DeleteTranscodeTemplateGroupResponse
 */
async function deleteTranscodeTemplateGroupWithOptions(request: DeleteTranscodeTemplateGroupRequest, runtime: $RuntimeOptions): DeleteTranscodeTemplateGroupResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.forceDelGroup)) {
    query['ForceDelGroup'] = request.forceDelGroup;
  }
  if (!$isNull(request.transcodeTemplateGroupId)) {
    query['TranscodeTemplateGroupId'] = request.transcodeTemplateGroupId;
  }
  if (!$isNull(request.transcodeTemplateIds)) {
    query['TranscodeTemplateIds'] = request.transcodeTemplateIds;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'DeleteTranscodeTemplateGroup',
    version = '2017-03-21',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Deletes one or more transcoding templates from a transcoding template group or forcibly deletes a transcoding template group.
 *
 * @description *   You cannot call this operation to delete the default transcoding template. You can delete the transcoding template when it is no longer specified as the default one.
 * *   For security purposes, you cannot add, modify, or delete transcoding templates in a transcoding template group that is locked. To check whether a transcoding template group is locked, call the [GetTranscodeTemplateGroup](~~GetTranscodeTemplateGroup~~) operation and obtain the Locked parameter from the response. To modify transcoding templates within a locked transcoding template group, you must call the [UpdateTranscodeTemplateGroup](~~UpdateTranscodeTemplateGroup~~) operation to unlock the transcoding template group first.
 *
 * @param request DeleteTranscodeTemplateGroupRequest
 * @return DeleteTranscodeTemplateGroupResponse
 */
async function deleteTranscodeTemplateGroup(request: DeleteTranscodeTemplateGroupRequest): DeleteTranscodeTemplateGroupResponse {
  var runtime = new $RuntimeOptions{};
  return deleteTranscodeTemplateGroupWithOptions(request, runtime);
}

model DeleteVideoRequest {
  videoIds?: string(name='VideoIds', description='The list of video IDs. Separate multiple IDs with commas (,). A maximum of 20 IDs can be specified. You can obtain a video ID in one of the following ways:

*   If the video is uploaded by using the [ApsaraVideo VOD console](https://vod.console.aliyun.com), log on to the console and choose **Media Files** > **Audio/Video** to view the ID of the video.
*   If the video is uploaded by calling the [CreateUploadVideo](https://help.aliyun.com/document_detail/55407.html) operation, the video ID is the VideoId value in the response.
*   You can also call the [SearchMedia](https://help.aliyun.com/document_detail/86044.html) operation to obtain the video ID, which is the VideoId value in the response.

This parameter is required.', example='e44ebf1147hdsa2d2adbea8b****,e44ebf11oj984adbea8****,73ab850b4f6f4b6e91d24d81d54****'),
}

model DeleteVideoResponseBody = {
  forbiddenVideoIds?: [ string ](name='ForbiddenVideoIds', description='The IDs of the videos that cannot be deleted.
> Generally, videos cannot be deleted if you do not have the required [permissions](https://help.aliyun.com/document_detail/113600.html).'),
  nonExistVideoIds?: [ string ](name='NonExistVideoIds', description='The IDs of the videos that do not exist.
> If the list of videos to be deleted contains one or more videos that do not exist, the IDs of these non-existing videos are returned. If none of the videos in the list exists, a 404 error is returned.'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='E4EBD2BF-5EB0-4476-8829-9D94E1B1****'),
}

model DeleteVideoResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DeleteVideoResponseBody(name='body'),
}

/**
 * @summary Deletes one or more videos at a time, including their mezzanine files, transcoded stream files, and thumbnail snapshots.
 *
 * @description *   This operation physically deletes videos. Deleted videos cannot be recovered. Exercise caution when you call this operation.
 * *   You can call this operation to delete multiple videos at a time.
 * *   When you delete a video, its source file, transcoded stream file, and thumbnail screenshot are also deleted. However, the Alibaba Cloud Content Delivery Network (CDN) cache is not refreshed simultaneously. You can use the refresh feature in the ApsaraVideo VOD console to clear garbage data on CDN nodes. For more information, see [Refresh and prefetch](https://help.aliyun.com/document_detail/86098.html).
 *
 * @param request DeleteVideoRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DeleteVideoResponse
 */
async function deleteVideoWithOptions(request: DeleteVideoRequest, runtime: $RuntimeOptions): DeleteVideoResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.videoIds)) {
    query['VideoIds'] = request.videoIds;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'DeleteVideo',
    version = '2017-03-21',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Deletes one or more videos at a time, including their mezzanine files, transcoded stream files, and thumbnail snapshots.
 *
 * @description *   This operation physically deletes videos. Deleted videos cannot be recovered. Exercise caution when you call this operation.
 * *   You can call this operation to delete multiple videos at a time.
 * *   When you delete a video, its source file, transcoded stream file, and thumbnail screenshot are also deleted. However, the Alibaba Cloud Content Delivery Network (CDN) cache is not refreshed simultaneously. You can use the refresh feature in the ApsaraVideo VOD console to clear garbage data on CDN nodes. For more information, see [Refresh and prefetch](https://help.aliyun.com/document_detail/86098.html).
 *
 * @param request DeleteVideoRequest
 * @return DeleteVideoResponse
 */
async function deleteVideo(request: DeleteVideoRequest): DeleteVideoResponse {
  var runtime = new $RuntimeOptions{};
  return deleteVideoWithOptions(request, runtime);
}

model DeleteVodDomainRequest {
  domainName?: string(name='DomainName', description='The domain name for CDN that you want to delete.

This parameter is required.', example='example.com'),
  ownerAccount?: string(name='OwnerAccount'),
  ownerId?: long(name='OwnerId'),
  securityToken?: string(name='SecurityToken'),
}

model DeleteVodDomainResponseBody = {
  requestId?: string(name='RequestId', description='The ID of the request.', example='15C66C7B-671A-4297-****-2C4477247A74'),
}

model DeleteVodDomainResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DeleteVodDomainResponseBody(name='body'),
}

/**
 * @summary Removes a domain name for CDN from ApsaraVideo VOD.
 *
 * @description > *   This operation is available only in the **China (Shanghai)** region.
 * > *   After a domain name for CDN is removed from ApsaraVideo VOD, the domain name becomes unavailable. Proceed with caution. We recommend that you restore the A record at your DNS service provider before you remove the domain name for CDN.
 * > *   After you call this operation to remove a domain name for CDN from ApsaraVideo VOD, all records that are related to the domain name are deleted. If you only want to disable a domain name for CDN, call the [BatchStopVodDomain](https://help.aliyun.com/document_detail/120208.html) operation.
 *
 * @param request DeleteVodDomainRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DeleteVodDomainResponse
 */
async function deleteVodDomainWithOptions(request: DeleteVodDomainRequest, runtime: $RuntimeOptions): DeleteVodDomainResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.domainName)) {
    query['DomainName'] = request.domainName;
  }
  if (!$isNull(request.ownerAccount)) {
    query['OwnerAccount'] = request.ownerAccount;
  }
  if (!$isNull(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!$isNull(request.securityToken)) {
    query['SecurityToken'] = request.securityToken;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'DeleteVodDomain',
    version = '2017-03-21',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Removes a domain name for CDN from ApsaraVideo VOD.
 *
 * @description > *   This operation is available only in the **China (Shanghai)** region.
 * > *   After a domain name for CDN is removed from ApsaraVideo VOD, the domain name becomes unavailable. Proceed with caution. We recommend that you restore the A record at your DNS service provider before you remove the domain name for CDN.
 * > *   After you call this operation to remove a domain name for CDN from ApsaraVideo VOD, all records that are related to the domain name are deleted. If you only want to disable a domain name for CDN, call the [BatchStopVodDomain](https://help.aliyun.com/document_detail/120208.html) operation.
 *
 * @param request DeleteVodDomainRequest
 * @return DeleteVodDomainResponse
 */
async function deleteVodDomain(request: DeleteVodDomainRequest): DeleteVodDomainResponse {
  var runtime = new $RuntimeOptions{};
  return deleteVodDomainWithOptions(request, runtime);
}

model DeleteVodSpecificConfigRequest {
  configId?: string(name='ConfigId', description='The ID of the configuration.

This parameter is required.', example='2317****'),
  domainName?: string(name='DomainName', description='The accelerated domain name.

This parameter is required.', example='www.example.com'),
  env?: string(name='Env', description='The environment from which the domain name configurations are deleted. Valid values:

*   online: production environment
*   gray: simulation environment', example='online'),
  ownerId?: long(name='OwnerId'),
  securityToken?: string(name='SecurityToken'),
}

model DeleteVodSpecificConfigResponseBody = {
  requestId?: string(name='RequestId', description='The ID of the request.', example='04F0F334-1335-436C-****-6C044FE73368'),
}

model DeleteVodSpecificConfigResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DeleteVodSpecificConfigResponseBody(name='body'),
}

/**
 * @summary Deletes the configurations of a domain name for CDN.
 *
 * @description > 
 * *   This operation is available only in the **China (Shanghai)** region.
 * *   After the configurations of a domain name for CDN are deleted, the domain name becomes unavailable. We recommend that you restore the A record at your DNS service provider before you delete the configurations of the domain name for CDN.
 * *   After you call this operation to remove a domain name for CDN from ApsaraVideo VOD, all records that are related to the domain name are deleted. If you only want to disable a domain name for CDN, call the [BatchStopVodDomain](https://help.aliyun.com/document_detail/120208.html) operation.
 *
 * @param request DeleteVodSpecificConfigRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DeleteVodSpecificConfigResponse
 */
async function deleteVodSpecificConfigWithOptions(request: DeleteVodSpecificConfigRequest, runtime: $RuntimeOptions): DeleteVodSpecificConfigResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.configId)) {
    query['ConfigId'] = request.configId;
  }
  if (!$isNull(request.domainName)) {
    query['DomainName'] = request.domainName;
  }
  if (!$isNull(request.env)) {
    query['Env'] = request.env;
  }
  if (!$isNull(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!$isNull(request.securityToken)) {
    query['SecurityToken'] = request.securityToken;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'DeleteVodSpecificConfig',
    version = '2017-03-21',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Deletes the configurations of a domain name for CDN.
 *
 * @description > 
 * *   This operation is available only in the **China (Shanghai)** region.
 * *   After the configurations of a domain name for CDN are deleted, the domain name becomes unavailable. We recommend that you restore the A record at your DNS service provider before you delete the configurations of the domain name for CDN.
 * *   After you call this operation to remove a domain name for CDN from ApsaraVideo VOD, all records that are related to the domain name are deleted. If you only want to disable a domain name for CDN, call the [BatchStopVodDomain](https://help.aliyun.com/document_detail/120208.html) operation.
 *
 * @param request DeleteVodSpecificConfigRequest
 * @return DeleteVodSpecificConfigResponse
 */
async function deleteVodSpecificConfig(request: DeleteVodSpecificConfigRequest): DeleteVodSpecificConfigResponse {
  var runtime = new $RuntimeOptions{};
  return deleteVodSpecificConfigWithOptions(request, runtime);
}

model DeleteVodTemplateRequest {
  vodTemplateId?: string(name='VodTemplateId', description='The ID of the snapshot template.

This parameter is required.', example='f5b228fe6930e*****d6bf55bd87789'),
}

model DeleteVodTemplateResponseBody = {
  requestId?: string(name='RequestId', description='The ID of the request.', example='25818875-5F78-4A*****F6-D7393642CA58'),
  vodTemplateId?: string(name='VodTemplateId', description='The ID of the snapshot template.', example='f5b228fe6930e*****d6bf55bd87789'),
}

model DeleteVodTemplateResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DeleteVodTemplateResponseBody(name='body'),
}

/**
 * @summary Deletes a snapshot template.
 *
 * @param request DeleteVodTemplateRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DeleteVodTemplateResponse
 */
async function deleteVodTemplateWithOptions(request: DeleteVodTemplateRequest, runtime: $RuntimeOptions): DeleteVodTemplateResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.vodTemplateId)) {
    query['VodTemplateId'] = request.vodTemplateId;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'DeleteVodTemplate',
    version = '2017-03-21',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Deletes a snapshot template.
 *
 * @param request DeleteVodTemplateRequest
 * @return DeleteVodTemplateResponse
 */
async function deleteVodTemplate(request: DeleteVodTemplateRequest): DeleteVodTemplateResponse {
  var runtime = new $RuntimeOptions{};
  return deleteVodTemplateWithOptions(request, runtime);
}

model DeleteWatermarkRequest {
  watermarkId?: string(name='WatermarkId', description='The ID of watermark template that you want to delete. You can specify only one watermark template ID. You can obtain the ID by using one of the following methods:

*   Obtain the watermark template ID from the response to the [AddWatermark](~~AddWatermark~~) operation that you call to create a watermark template.
*   Obtain the watermark template ID from the response to the [ListWatermark](~~ListWatermark~~) operation that you call to query all watermark templates within your account.

This parameter is required.', example='9bcc8bfadb843f*****09a2671d0df97'),
}

model DeleteWatermarkResponseBody = {
  requestId?: string(name='RequestId', description='The ID of the request.', example='25818875-5F78-4A*****F6-D7393642CA58'),
}

model DeleteWatermarkResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DeleteWatermarkResponseBody(name='body'),
}

/**
 * @summary Deletes an image watermark or text watermark template.
 *
 * @description *   **After you delete an image watermark template, the source watermark file is physically deleted and cannot be restored. Exercise caution when you call this operation.**
 * *   You cannot delete the default watermark template. To delete a default watermark template, call the [SetDefaultWatermark](~~SetDefaultWatermark~~) operation to set another watermark template as the default one.
 *
 * @param request DeleteWatermarkRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DeleteWatermarkResponse
 */
async function deleteWatermarkWithOptions(request: DeleteWatermarkRequest, runtime: $RuntimeOptions): DeleteWatermarkResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.watermarkId)) {
    query['WatermarkId'] = request.watermarkId;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'DeleteWatermark',
    version = '2017-03-21',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Deletes an image watermark or text watermark template.
 *
 * @description *   **After you delete an image watermark template, the source watermark file is physically deleted and cannot be restored. Exercise caution when you call this operation.**
 * *   You cannot delete the default watermark template. To delete a default watermark template, call the [SetDefaultWatermark](~~SetDefaultWatermark~~) operation to set another watermark template as the default one.
 *
 * @param request DeleteWatermarkRequest
 * @return DeleteWatermarkResponse
 */
async function deleteWatermark(request: DeleteWatermarkRequest): DeleteWatermarkResponse {
  var runtime = new $RuntimeOptions{};
  return deleteWatermarkWithOptions(request, runtime);
}

model DescribeMediaDistributionRequest {
  endTime?: string(name='EndTime', description='The end of the time range to query. The end time must be later than the start time. Specify the time in the ISO 8601 standard in the yyyy-MM-ddTHH:mm:ssZ format. The time must be in UTC. The maximum time range to query is 6 months.', example='2017-01-11T12:59:00Z'),
  interval?: string(name='Interval', description='The statistical interval. Default value: day. Valid values:

*   hour: natural hour of the start and end time.
*   day: natural day of the start and end time.
*   week: natural week of the start and end time.
*   month: natural month of the start and end time.', example='day'),
  startTime?: string(name='StartTime', description='The beginning of the time range to query. Specify the time in the ISO 8601 standard in the yyyy-MM-ddTHH:mm:ssZ format. The time must be in UTC. The maximum time range to query is 6 months.', example='2017-01-11T12:00:00Z'),
  storageClass?: string(name='StorageClass', description='The hierarchical storage type. Valid values:

*   Standard
*   IA
*   Archive
*   ColdArchive
*   SourceIA
*   SourceArchive
*   SourceColdArchive
*   Changing
*   SourceChanging', example='Standard'),
}

model DescribeMediaDistributionResponseBody = {
  mediaDistributionList?: [ 
    {
      count?: long(name='Count', description='The number of media assets that are queried during the specified time range.', example='12'),
      endTime?: string(name='EndTime', description='The end of the time range during which data is queried (exclusive). The time follows the ISO 8601 standard in the yyyy-MM-ddTHH:mm:ssZ format. The time is displayed in UTC.', example='2017-11-14T00:00:00Z'),
      startTime?: string(name='StartTime', description='The start of the time range during which data is queried (inclusive). The time follows the ISO 8601 standard in the yyyy-MM-ddTHH:mm:ssZ format. The time is displayed in UTC.', example='2017-11-13T00:00:00Z'),
    }
  ](name='MediaDistributionList', description='The distribution list of media assets. The data is displayed based on the statistical cycle of the natural hour, day, week, or month of the start and end time.'),
  requestId?: string(name='RequestId', description='The request ID.', example='25818875-5F78-4AF6-D7393642CA58****'),
  total?: long(name='Total', description='The total number of media assets returned.', example='100'),
}

model DescribeMediaDistributionResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeMediaDistributionResponseBody(name='body'),
}

/**
 * @summary Queries the distribution of media asset data by time. The maximum time range to query is 6 months.
 *
 * @description *   This operation is available only in the China (Shanghai) region.
 * *   If you do not set the StartTime or EndTime parameter, the request returns the data collected in the previous 7 days. If you set both the parameters, the request returns the data collected within the specified time range.
 *
 * @param request DescribeMediaDistributionRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeMediaDistributionResponse
 */
async function describeMediaDistributionWithOptions(request: DescribeMediaDistributionRequest, runtime: $RuntimeOptions): DescribeMediaDistributionResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.endTime)) {
    query['EndTime'] = request.endTime;
  }
  if (!$isNull(request.interval)) {
    query['Interval'] = request.interval;
  }
  if (!$isNull(request.startTime)) {
    query['StartTime'] = request.startTime;
  }
  if (!$isNull(request.storageClass)) {
    query['StorageClass'] = request.storageClass;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'DescribeMediaDistribution',
    version = '2017-03-21',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Queries the distribution of media asset data by time. The maximum time range to query is 6 months.
 *
 * @description *   This operation is available only in the China (Shanghai) region.
 * *   If you do not set the StartTime or EndTime parameter, the request returns the data collected in the previous 7 days. If you set both the parameters, the request returns the data collected within the specified time range.
 *
 * @param request DescribeMediaDistributionRequest
 * @return DescribeMediaDistributionResponse
 */
async function describeMediaDistribution(request: DescribeMediaDistributionRequest): DescribeMediaDistributionResponse {
  var runtime = new $RuntimeOptions{};
  return describeMediaDistributionWithOptions(request, runtime);
}

model DescribePlayTopVideosRequest {
  bizDate?: string(name='BizDate', description='The time to query. Specify the time in the ISO 8601 standard in the yyyy-MM-ddTHH:mm:ssZ format. The time must be in UTC.

This parameter is required.', example='2016-06-29T13:00:00Z'),
  ownerId?: long(name='OwnerId'),
  pageNo?: long(name='PageNo', description='The page number. Default value: **1**.', example='1'),
  pageSize?: long(name='PageSize', description='The number of entries to return on each page. The default value is **100**. The maximum value is **1000**.', example='100'),
}

model DescribePlayTopVideosResponseBody = {
  pageNo?: long(name='PageNo', description='The page number.', example='1'),
  pageSize?: long(name='PageSize', description='The number of entries per page.', example='100'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='4B0BCF9F-2FD5-4817-****-7BEBBE3AF90B"'),
  topPlayVideos?: {
    topPlayVideoStatis?: [ 
    {
      playDuration?: string(name='PlayDuration', description='The total playback duration. Unit: milliseconds.', example='4640369'),
      title?: string(name='Title', description='The title of the video.', example='Four streams (two streams encrypted): LD-HLS-encrypted + SD-MP4 + HD-H'),
      UV?: string(name='UV', description='The number of unique visitors.', example='1'),
      VV?: string(name='VV', description='The number of video views.', example='107'),
      videoId?: string(name='VideoId', description='The ID of the video.', example='2a8d4cb9ecbb487681473a15****8fda'),
    }
  ](name='TopPlayVideoStatis')
  }(name='TopPlayVideos', description='The daily playback statistics on each top video.'),
  totalNum?: long(name='TotalNum', description='The total number of entries that were collected in playback statistics on top videos.', example='2'),
}

model DescribePlayTopVideosResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribePlayTopVideosResponseBody(name='body'),
}

/**
 * @summary Queries daily playback statistics on top videos, including video views, unique visitors, and total playback duration.
 *
 * @description *   This operation is available only in the **China (Shanghai)** region.
 * *   You can query playback statistics on top 1,000 videos at most on a specified day. By default, top videos are sorted in descending order based on video views.
 * *   You can call this operation to query only playback statistics collected on videos that are played by using ApsaraVideo Player SDKs.
 * *   Playback statistics for the previous day are generated at 09:00 on the current day, in UTC+8.
 * *   You can query data that is generated since January 1, 2018. The maximum time range to query is 180 days.
 *
 * @param request DescribePlayTopVideosRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribePlayTopVideosResponse
 */
async function describePlayTopVideosWithOptions(request: DescribePlayTopVideosRequest, runtime: $RuntimeOptions): DescribePlayTopVideosResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.bizDate)) {
    query['BizDate'] = request.bizDate;
  }
  if (!$isNull(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!$isNull(request.pageNo)) {
    query['PageNo'] = request.pageNo;
  }
  if (!$isNull(request.pageSize)) {
    query['PageSize'] = request.pageSize;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'DescribePlayTopVideos',
    version = '2017-03-21',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Queries daily playback statistics on top videos, including video views, unique visitors, and total playback duration.
 *
 * @description *   This operation is available only in the **China (Shanghai)** region.
 * *   You can query playback statistics on top 1,000 videos at most on a specified day. By default, top videos are sorted in descending order based on video views.
 * *   You can call this operation to query only playback statistics collected on videos that are played by using ApsaraVideo Player SDKs.
 * *   Playback statistics for the previous day are generated at 09:00 on the current day, in UTC+8.
 * *   You can query data that is generated since January 1, 2018. The maximum time range to query is 180 days.
 *
 * @param request DescribePlayTopVideosRequest
 * @return DescribePlayTopVideosResponse
 */
async function describePlayTopVideos(request: DescribePlayTopVideosRequest): DescribePlayTopVideosResponse {
  var runtime = new $RuntimeOptions{};
  return describePlayTopVideosWithOptions(request, runtime);
}

model DescribePlayUserAvgRequest {
  endTime?: string(name='EndTime', description='The end of the time range to query. The end time must be later than the start time. Specify the time in the ISO 8601 standard in the *yyyy-MM-dd*T*HH:mm:ss*Z format. The time must be in UTC.

This parameter is required.', example='2016-06-30T13:00:00Z'),
  ownerId?: long(name='OwnerId'),
  startTime?: string(name='StartTime', description='The beginning of the time range to query. Specify the time in the ISO 8601 standard in the *yyyy-MM-dd*T*HH:mm:ss*Z format. The time must be in UTC.

This parameter is required.', example='2016-06-29T13:00:00Z'),
}

model DescribePlayUserAvgResponseBody = {
  requestId?: string(name='RequestId', description='The ID of the request.', example='6C7F90B2-BDA4-4FAC-****-A38A121DFE19'),
  userPlayStatisAvgs?: {
    userPlayStatisAvg?: [ 
    {
      avgPlayCount?: string(name='AvgPlayCount', description='The average number of video views.', example='170'),
      avgPlayDuration?: string(name='AvgPlayDuration', description='The average playback duration. Unit: milliseconds.', example='1035902.8'),
      date?: string(name='Date', description='The date when the statistics were generated. The date follows the *yyyy-MM-dd* format.', example='20170120'),
    }
  ](name='UserPlayStatisAvg')
  }(name='UserPlayStatisAvgs', description='The statistics on average playback each day.'),
}

model DescribePlayUserAvgResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribePlayUserAvgResponseBody(name='body'),
}

/**
 * @summary Queries the statistics on average playback each day in a specified time range.
 *
 * @description > *   This operation is available only in the **China (Shanghai)** region.
 * > *   You can call this operation to query only playback statistics collected on videos that are played by using ApsaraVideo Player SDKs.
 * > *   Playback statistics for the previous day are generated at 09:00 on the current day, in UTC+8.
 * > *   You can query data that is generated since January 1, 2018. The maximum time range to query is 180 days.
 *
 * @param request DescribePlayUserAvgRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribePlayUserAvgResponse
 */
async function describePlayUserAvgWithOptions(request: DescribePlayUserAvgRequest, runtime: $RuntimeOptions): DescribePlayUserAvgResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.endTime)) {
    query['EndTime'] = request.endTime;
  }
  if (!$isNull(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!$isNull(request.startTime)) {
    query['StartTime'] = request.startTime;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'DescribePlayUserAvg',
    version = '2017-03-21',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Queries the statistics on average playback each day in a specified time range.
 *
 * @description > *   This operation is available only in the **China (Shanghai)** region.
 * > *   You can call this operation to query only playback statistics collected on videos that are played by using ApsaraVideo Player SDKs.
 * > *   Playback statistics for the previous day are generated at 09:00 on the current day, in UTC+8.
 * > *   You can query data that is generated since January 1, 2018. The maximum time range to query is 180 days.
 *
 * @param request DescribePlayUserAvgRequest
 * @return DescribePlayUserAvgResponse
 */
async function describePlayUserAvg(request: DescribePlayUserAvgRequest): DescribePlayUserAvgResponse {
  var runtime = new $RuntimeOptions{};
  return describePlayUserAvgWithOptions(request, runtime);
}

model DescribePlayUserTotalRequest {
  endTime?: string(name='EndTime', description='The end of the time range to query. Specify the time in the ISO 8601 standard in the *yyyy-MM-dd*T*HH:mm:ss*Z format. The time must be in UTC.

>  The end time must be later than the start time. The interval between the start time and the end time cannot exceed 180 days.

This parameter is required.', example='2016-06-30T13:00:00Z'),
  ownerId?: long(name='OwnerId'),
  startTime?: string(name='StartTime', description='The beginning of the time range to query. Specify the time in the ISO 8601 standard in the yyyy-MM-ddTHH:mm:ssZ format. The time must be in UTC.

This parameter is required.', example='2016-06-29T13:00:00Z'),
}

model DescribePlayUserTotalResponseBody = {
  requestId?: string(name='RequestId', description='The ID of the request.', example='1FAFB884-D5A7-47D1-****-8928AA9C8720'),
  userPlayStatisTotals?: {
    userPlayStatisTotal?: [ 
    {
      date?: string(name='Date', description='The date. The date is displayed in the yyyy-MM-dd format.', example='20170120'),
      playDuration?: string(name='PlayDuration', description='The total playback duration. Unit: milliseconds.', example='9340070'),
      playRange?: string(name='PlayRange', description='The distribution of the playback duration.', example='"<=1m:74.3%;>1<=5m:22.8%;>5<=10m:1.0%;>10<=15m:1.0%;>15<=30m:1.0%"'),
      UV?: {
        android?: string(name='Android', description='The total number of unique visitors who use ApsaraVideo Player SDK for Android.', example='2'),
        flash?: string(name='Flash', description='The total number of unique visitors who use the Flash player.', example='1'),
        HTML5?: string(name='HTML5', description='The total number of unique visitors who use the HTML5 player.', example='1'),
        iOS?: string(name='iOS', description='The total number of unique visitors who use ApsaraVideo Player SDK for iOS.', example='0'),
      }(name='UV', description='The total number of unique visitors.'),
      VV?: {
        android?: string(name='Android', description='The total number of video views played by using ApsaraVideo Player SDK for Android.', example='161'),
        flash?: string(name='Flash', description='The total number of video views played by using the Flash player.', example='2'),
        HTML5?: string(name='HTML5', description='The total number of video views played by using the HTML5 player.', example='2'),
        iOS?: string(name='iOS', description='The total number of video views played by using ApsaraVideo Player SDK for iOS.', example='0'),
      }(name='VV', description='The total number of video views.'),
    }
  ](name='UserPlayStatisTotal')
  }(name='UserPlayStatisTotals', description='The daily playback statistics.'),
}

model DescribePlayUserTotalResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribePlayUserTotalResponseBody(name='body'),
}

/**
 * @summary Queries the daily playback statistics in a specified time range. The playback statistics include the total number of views, total number of viewers, total playback duration, and playback duration distribution.
 *
 * @description *   This operation is available only in the **China (Shanghai)** region.
 * *   You can call this operation to query only playback statistics collected on videos that are played by using ApsaraVideo Player SDKs.
 * *   Playback statistics for the current day are generated at 09:00 (UTC+8) on the next day.
 * *   You can query data that is generated since January 1, 2018. The maximum time range to query is 180 days.
 *
 * @param request DescribePlayUserTotalRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribePlayUserTotalResponse
 */
async function describePlayUserTotalWithOptions(request: DescribePlayUserTotalRequest, runtime: $RuntimeOptions): DescribePlayUserTotalResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.endTime)) {
    query['EndTime'] = request.endTime;
  }
  if (!$isNull(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!$isNull(request.startTime)) {
    query['StartTime'] = request.startTime;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'DescribePlayUserTotal',
    version = '2017-03-21',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Queries the daily playback statistics in a specified time range. The playback statistics include the total number of views, total number of viewers, total playback duration, and playback duration distribution.
 *
 * @description *   This operation is available only in the **China (Shanghai)** region.
 * *   You can call this operation to query only playback statistics collected on videos that are played by using ApsaraVideo Player SDKs.
 * *   Playback statistics for the current day are generated at 09:00 (UTC+8) on the next day.
 * *   You can query data that is generated since January 1, 2018. The maximum time range to query is 180 days.
 *
 * @param request DescribePlayUserTotalRequest
 * @return DescribePlayUserTotalResponse
 */
async function describePlayUserTotal(request: DescribePlayUserTotalRequest): DescribePlayUserTotalResponse {
  var runtime = new $RuntimeOptions{};
  return describePlayUserTotalWithOptions(request, runtime);
}

model DescribePlayVideoStatisRequest {
  endTime?: string(name='EndTime', description='The end of the time range to query. Specify the time in the ISO 8601 standard in the *yyyy-MM-dd*T*HH:mm:ss*Z format. The time must be in UTC.

>  The end time must be later than the start time. The interval between the start time and the end time cannot exceed 180 days.

This parameter is required.', example='2016-06-30T13:00:00Z'),
  ownerId?: long(name='OwnerId'),
  startTime?: string(name='StartTime', description='The beginning of the time range to query. Specify the time in the ISO 8601 standard in the *yyyy-MM-dd*T*HH:mm:ss*Z format. The time must be in UTC.

This parameter is required.', example='2016-06-29T13:00:00Z'),
  videoId?: string(name='VideoId', description='The ID of the video. You can specify only one ID. You can use one of the following methods to obtain the ID:

*   Log on to the [ApsaraVideo VOD console](https://vod.console.aliyun.com). In the left-side navigation pane, choose **Media Files** > **Audio/Video**. On the page that appears, view the video ID.
*   Obtain the video ID from the response to the [CreateUploadVideo](~~CreateUploadVideo~~) operation that you call to obtain the upload URL and credential.
*   Obtain the video ID from the response to the [SearchMedia](~~SearchMedia~~) operation that you call to query the audio or video file.

This parameter is required.', example='2a8d4cb9ecbb487681473****aba8fda'),
}

model DescribePlayVideoStatisResponseBody = {
  requestId?: string(name='RequestId', description='The request ID.', example='A92D3600-A3E7-43D6-****-B6E3B4A1FE6B'),
  videoPlayStatisDetails?: {
    videoPlayStatisDetail?: [ 
    {
      date?: string(name='Date', description='The date. The time follows the ISO 8601 standard in the *YYYY-MM-DD*T*hh:mm:ss* format. The time is displayed in UTC.', example='20170120'),
      playDuration?: string(name='PlayDuration', description='The total playback duration. Unit: milliseconds.', example='967277'),
      playRange?: string(name='PlayRange', description='The distribution of the playback duration.', example='<=1m:79.2%;>1<=5m:16.7%;>5<=10m:4.2%'),
      title?: string(name='Title', description='The video title.', example='Four streams (one stream encrypted): LD-HLS + SD-MP4 + HD-HLS-encrypted + UHD-MP4'),
      UV?: string(name='UV', description='The number of unique visitors.', example='1'),
      VV?: string(name='VV', description='The number of video views.', example='24'),
    }
  ](name='VideoPlayStatisDetail')
  }(name='VideoPlayStatisDetails', description='The daily playback statistics on the video.'),
}

model DescribePlayVideoStatisResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribePlayVideoStatisResponseBody(name='body'),
}

/**
 * @summary Queries daily playback statistics on a video in the specified time range.
 *
 * @description *   This operation is available only in the **China (Shanghai)** region.
 * *   You can call this operation to query only playback statistics collected on videos that are played by using ApsaraVideo Player SDKs.
 * *   Playback statistics for the current day are generated at 09:00 (UTC+8) on the next day.
 * *   You can query only data in the last 730 days. The maximum time range to query is 180 days.
 *
 * @param request DescribePlayVideoStatisRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribePlayVideoStatisResponse
 */
async function describePlayVideoStatisWithOptions(request: DescribePlayVideoStatisRequest, runtime: $RuntimeOptions): DescribePlayVideoStatisResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.endTime)) {
    query['EndTime'] = request.endTime;
  }
  if (!$isNull(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!$isNull(request.startTime)) {
    query['StartTime'] = request.startTime;
  }
  if (!$isNull(request.videoId)) {
    query['VideoId'] = request.videoId;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'DescribePlayVideoStatis',
    version = '2017-03-21',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Queries daily playback statistics on a video in the specified time range.
 *
 * @description *   This operation is available only in the **China (Shanghai)** region.
 * *   You can call this operation to query only playback statistics collected on videos that are played by using ApsaraVideo Player SDKs.
 * *   Playback statistics for the current day are generated at 09:00 (UTC+8) on the next day.
 * *   You can query only data in the last 730 days. The maximum time range to query is 180 days.
 *
 * @param request DescribePlayVideoStatisRequest
 * @return DescribePlayVideoStatisResponse
 */
async function describePlayVideoStatis(request: DescribePlayVideoStatisRequest): DescribePlayVideoStatisResponse {
  var runtime = new $RuntimeOptions{};
  return describePlayVideoStatisWithOptions(request, runtime);
}

model DescribeVodAIDataRequest {
  AIType?: string(name='AIType', description='The type of video AI. If you leave this parameter empty, statistics on video AI of all types are returned. Separate multiple types with commas (,). Valid values:

*   **AIVideoCensor**: automated review
*   **AIVideoFPShot**: media fingerprinting
*   **AIVideoTag**: smart tagging', example='AIVideoCensor'),
  endTime?: string(name='EndTime', description='The end of the time range to query. The end time must be later than the start time. Specify the time in the ISO 8601 standard in the `yyyy-MM-ddTHH:mm:ssZ` format. The time must be in UTC.

This parameter is required.', example='2019-02-01T15:00:00Z'),
  ownerId?: long(name='OwnerId'),
  region?: string(name='Region', description='The region in which you want to query data. If you leave this parameter empty, data in all regions is returned. Separate multiple regions with commas (,). Valid values:

*   **cn-shanghai**: China (Shanghai)
*   **cn-beijing**: China (Beijing)
*   **eu-central-1**: Germany (Frankfurt)
*   **ap-southeast-1**: Singapore', example='cn-beijing'),
  startTime?: string(name='StartTime', description='The beginning of the time range to query. Specify the time in the ISO 8601 standard in the `yyyy-MM-ddTHH:mm:ssZ` format. The time must be in UTC.

This parameter is required.', example='2019-02-01T13:00:00Z'),
}

model DescribeVodAIDataResponseBody = {
  AIData?: {
    AIDataItem?: [ 
    {
      data?: {
        dataItem?: [ 
        {
          name?: string(name='Name', description='The type of video AI. Valid values:

*   **AIVideoCensor**: automated review
*   **AIVideoFPShot**: media fingerprinting
*   **AIVideoTag**: smart tagging', example='AIVideoCensor'),
          value?: string(name='Value', description='The processing duration. Unit: seconds.', example='111'),
        }
      ](name='DataItem')
      }(name='Data', description='The statistics on video AI of each type.'),
      timeStamp?: string(name='TimeStamp', description='The timestamp of the returned data. The time follows the ISO 8601 standard in the `yyyy-MM-ddTHH:mm:ssZ` format. The time is displayed in UTC.', example='2019-02-01T13:00:00Z'),
    }
  ](name='AIDataItem')
  }(name='AIData', description='The statistics on video AI.'),
  dataInterval?: string(name='DataInterval', description='The time granularity at which the data was queried. Valid values:

*   **hour**
*   **day**', example='day'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='C370DAF1-C838-4288-****-9A87633D248E'),
}

model DescribeVodAIDataResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeVodAIDataResponseBody(name='body'),
}

/**
 * @summary Queries the statistics on video AI of different types, such as automated review and media fingerprinting.
 *
 * @description > *   This operation is available only in the **China (Shanghai)** region.
 * >*   If the time range to query is less than or equal to seven days, the system returns the statistics collected on an hourly basis. If the time range to query is greater than seven days, the system returns the statistics collected on a daily basis. The maximum time range that you can specify to query is 31 days.
 *
 * @param request DescribeVodAIDataRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeVodAIDataResponse
 */
async function describeVodAIDataWithOptions(request: DescribeVodAIDataRequest, runtime: $RuntimeOptions): DescribeVodAIDataResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.AIType)) {
    query['AIType'] = request.AIType;
  }
  if (!$isNull(request.endTime)) {
    query['EndTime'] = request.endTime;
  }
  if (!$isNull(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!$isNull(request.region)) {
    query['Region'] = request.region;
  }
  if (!$isNull(request.startTime)) {
    query['StartTime'] = request.startTime;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'DescribeVodAIData',
    version = '2017-03-21',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Queries the statistics on video AI of different types, such as automated review and media fingerprinting.
 *
 * @description > *   This operation is available only in the **China (Shanghai)** region.
 * >*   If the time range to query is less than or equal to seven days, the system returns the statistics collected on an hourly basis. If the time range to query is greater than seven days, the system returns the statistics collected on a daily basis. The maximum time range that you can specify to query is 31 days.
 *
 * @param request DescribeVodAIDataRequest
 * @return DescribeVodAIDataResponse
 */
async function describeVodAIData(request: DescribeVodAIDataRequest): DescribeVodAIDataResponse {
  var runtime = new $RuntimeOptions{};
  return describeVodAIDataWithOptions(request, runtime);
}

model DescribeVodCertificateListRequest {
  domainName?: string(name='DomainName', description='The domain name for CDN.', example='example.com'),
  ownerId?: long(name='OwnerId'),
  securityToken?: string(name='SecurityToken'),
}

model DescribeVodCertificateListResponseBody = {
  certificateListModel?: {
    certList?: {
      cert?: [ 
      {
        algorithm?: string(name='Algorithm', description='The algorithm.', example='RSA'),
        certId?: long(name='CertId', description='The ID of the certificate.', example='235437'),
        certIdentifier?: string(name='CertIdentifier', description='The ID of the certificate.', example='14173772-cn-hangzhou'),
        certName?: string(name='CertName', description='The name of the certificate.', example='certificate'),
        common?: string(name='Common', description='The common name of the certificate.', example='test'),
        createTime?: long(name='CreateTime', description='The time when the certificate was created.', example='1725206400000'),
        domainMatchCert?: boolean(name='DomainMatchCert', description='DomainMatchCert.', example='false'),
        endTime?: long(name='EndTime', description='The time when the certificate expired.', example='1759507200000'),
        fingerprint?: string(name='Fingerprint', description='The fingerprint of the certificate.', example='****'),
        instanceId?: string(name='InstanceId', description='The ID of the instance.', example='cert-cn-cd806ae0fdfbfa60'),
        issuer?: string(name='Issuer', description='The certificate authority (CA) that issued the certificate.', example='****'),
        lastTime?: long(name='LastTime', description='The time when the certificate was issued. Unit: seconds.', example='1512388610'),
        signAlgorithm?: string(name='SignAlgorithm', description='The signAlgorithm.', example='sha256withrsa'),
      }
    ](name='Cert')
    }(name='CertList', description='The list of certificates.'),
    count?: int32(name='Count', description='The number of certificates that are returned.', example='2'),
  }(name='CertificateListModel', description='The information about each certificate.'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='FC0E34AC-0239-44A7-****-800DE522C8DA'),
}

model DescribeVodCertificateListResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeVodCertificateListResponseBody(name='body'),
}

/**
 * @summary Queries the certificates of a specified domain name for CDN or all the domain names for CDN within your Alibaba Cloud account.
 *
 * @description >  This operation is available only in the **China (Shanghai)** region.
 *
 * @param request DescribeVodCertificateListRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeVodCertificateListResponse
 */
async function describeVodCertificateListWithOptions(request: DescribeVodCertificateListRequest, runtime: $RuntimeOptions): DescribeVodCertificateListResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.domainName)) {
    query['DomainName'] = request.domainName;
  }
  if (!$isNull(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!$isNull(request.securityToken)) {
    query['SecurityToken'] = request.securityToken;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'DescribeVodCertificateList',
    version = '2017-03-21',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Queries the certificates of a specified domain name for CDN or all the domain names for CDN within your Alibaba Cloud account.
 *
 * @description >  This operation is available only in the **China (Shanghai)** region.
 *
 * @param request DescribeVodCertificateListRequest
 * @return DescribeVodCertificateListResponse
 */
async function describeVodCertificateList(request: DescribeVodCertificateListRequest): DescribeVodCertificateListResponse {
  var runtime = new $RuntimeOptions{};
  return describeVodCertificateListWithOptions(request, runtime);
}

model DescribeVodDomainBpsDataRequest {
  domainName?: string(name='DomainName', description='The domain name to be queried. If you do not specify this parameter, the merged data of all your domain names for CDN is returned. You can specify multiple domain names. Separate them with commas (,).', example='example.com'),
  endTime?: string(name='EndTime', description='The end of the time range to query. The end time must be later than the start time. Specify the time in the ISO 8601 standard in the *yyyy-MM-dd*T*HH:mm:ss*Z format. The time must be in UTC.', example='2015-12-10T14:00:00Z'),
  interval?: string(name='Interval', description='The query interval. Unit: seconds. Valid values: **300**, **3600**, and **86400**.

*   If the time range to query is less than 3 days, valid values are **300**, **3600**, and **86400**. The default value is 300.
*   If the time range to query is from 3 to less than 31 days, valid values are **3600** and **86400**. The default value is 3600.
*   If the time range to query is from 31 to 90 days, the valid value is **86400**.', example='300'),
  ispNameEn?: string(name='IspNameEn', description='The name of the Internet service provider (ISP). If you do not specify this parameter, the data of all ISPs is returned.', example='Alibaba'),
  locationNameEn?: string(name='LocationNameEn', description='The name of the region. If you do not specify this parameter, the data in all regions is returned. Only data in the China (Shanghai) region can be queried.', example='cn-shanghai'),
  ownerId?: long(name='OwnerId'),
  startTime?: string(name='StartTime', description='The beginning of the time range to query. Specify the time in the ISO 8601 standard in the *yyyy-MM-dd*T*HH:mm:ss*Z format. The time must be in UTC.

> The minimum query interval is 5 minutes. If you do not specify this parameter, the data in the last 24 hours is queried.', example='2015-12-10T13:00:00Z'),
}

model DescribeVodDomainBpsDataResponseBody = {
  bpsDataPerInterval?: {
    dataModule?: [ 
    {
      domesticValue?: string(name='DomesticValue', description='The bandwidth in mainland China. Unit: bit/s. When the bandwidth data is queried by ISP, no value is returned.', example='11286111'),
      httpsDomesticValue?: string(name='HttpsDomesticValue', description='The HTTPS bandwidth on L1 nodes in mainland China. Unit: bit/s. When the bandwidth data is queried by ISP, no value is returned.', example='11286111'),
      httpsOverseasValue?: string(name='HttpsOverseasValue', description='The HTTPS bandwidth on L1 nodes outside mainland China. Unit: bit/s. When the bandwidth data is queried by ISP, no value is returned.', example='2000'),
      httpsValue?: string(name='HttpsValue', description='The total HTTPS bandwidth on L1 nodes. Unit: bit/s.', example='11288111'),
      overseasValue?: string(name='OverseasValue', description='The bandwidth outside mainland China. Unit: bit/s. When the bandwidth data is queried by ISP, no value is returned.', example='2000'),
      timeStamp?: string(name='TimeStamp', description='The timestamp of the returned data. The time follows the ISO 8601 standard in the yyyy-MM-ddTHH:mm:ssZ format. The time is displayed in UTC.', example='2015-12-10T13:00:00Z'),
      value?: string(name='Value', description='The bandwidth. Unit: bit/s.', example='11288111'),
    }
  ](name='DataModule')
  }(name='BpsDataPerInterval', description='The bandwidth data that is collected for each interval.'),
  dataInterval?: string(name='DataInterval', description='The time interval between the returned entries. Unit: seconds.', example='300'),
  domainName?: string(name='DomainName', description='The domain name for CDN.', example='example.com'),
  endTime?: string(name='EndTime', description='The end of the time range in which data was queried. The time follows the ISO 8601 standard in the *yyyy-MM-dd*T*HH:mm:ss*Z format. The time is displayed in UTC.', example='2015-12-10T14:00:00Z'),
  ispNameEn?: string(name='IspNameEn', description='The name of the ISP. By default, the data of all ISPs is returned.', example='Alibaba'),
  locationNameEn?: string(name='LocationNameEn', description='The name of the region. By default, the data in all regions is returned.', example='cn-shanghai'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='3C6CCEC4-6B88-4D4A-****-D47B3D92CF8F'),
  startTime?: string(name='StartTime', description='The beginning of the time range in which data was queried. The time follows the ISO 8601 standard in the *yyyy-MM-dd*T*HH:mm:ss*Z format. The time is displayed in UTC.', example='2015-12-10T13:00:00Z'),
}

model DescribeVodDomainBpsDataResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeVodDomainBpsDataResponseBody(name='body'),
}

/**
 * @summary Queries the bandwidth for one or more specified domain names for CDN.
 *
 * @description If you specify neither the StartTime parameter nor the EndTime parameter, the data in the last 24 hours is queried. Alternatively, you can specify both the StartTime and EndTime parameters to query data that is generated in the specified duration. You can query data for the last 90 days at most.
 *
 * @param request DescribeVodDomainBpsDataRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeVodDomainBpsDataResponse
 */
async function describeVodDomainBpsDataWithOptions(request: DescribeVodDomainBpsDataRequest, runtime: $RuntimeOptions): DescribeVodDomainBpsDataResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.domainName)) {
    query['DomainName'] = request.domainName;
  }
  if (!$isNull(request.endTime)) {
    query['EndTime'] = request.endTime;
  }
  if (!$isNull(request.interval)) {
    query['Interval'] = request.interval;
  }
  if (!$isNull(request.ispNameEn)) {
    query['IspNameEn'] = request.ispNameEn;
  }
  if (!$isNull(request.locationNameEn)) {
    query['LocationNameEn'] = request.locationNameEn;
  }
  if (!$isNull(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!$isNull(request.startTime)) {
    query['StartTime'] = request.startTime;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'DescribeVodDomainBpsData',
    version = '2017-03-21',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Queries the bandwidth for one or more specified domain names for CDN.
 *
 * @description If you specify neither the StartTime parameter nor the EndTime parameter, the data in the last 24 hours is queried. Alternatively, you can specify both the StartTime and EndTime parameters to query data that is generated in the specified duration. You can query data for the last 90 days at most.
 *
 * @param request DescribeVodDomainBpsDataRequest
 * @return DescribeVodDomainBpsDataResponse
 */
async function describeVodDomainBpsData(request: DescribeVodDomainBpsDataRequest): DescribeVodDomainBpsDataResponse {
  var runtime = new $RuntimeOptions{};
  return describeVodDomainBpsDataWithOptions(request, runtime);
}

model DescribeVodDomainBpsDataByLayerRequest {
  domainName?: string(name='DomainName', description='The accelerated domain name. You can specify a maximum of 500 accelerated domain names. Separate multiple domain names with commas (,).', example='example.com'),
  endTime?: string(name='EndTime', description='The end of the time range to query.

Specify the time in the ISO 8601 standard in the yyyy-MM-ddTHH:mm:ssZ format. The time must be in UTC.', example='2019-01-23T12:40:12Z'),
  interval?: string(name='Interval', description='The time interval between the data entries. Unit: seconds.

The time granularity varies based on the maximum time range per query. Valid values: 300 (5 minutes), 3600 (1 hour), and 86400 (1 day). For more information, see the supported time granularity described in Usage notes.', example='300'),
  ispNameEn?: string(name='IspNameEn', description='The name of the Internet service provider (ISP).', example='unicom'),
  layer?: string(name='Layer', description='The layer at which you want to query the data.

Network layer: IPv4 and IPv6. Application layer: http, https, and quic. all: specifies that both the network and application layers are included. Default value: all.', example='IPv4'),
  locationNameEn?: string(name='LocationNameEn', description='The name of the region.', example='beijing'),
  ownerId?: long(name='OwnerId'),
  startTime?: string(name='StartTime', description='The beginning of the time range to query.

Specify the time in the ISO 8601 standard in the yyyy-MM-ddTHH:mm:ssZ format. The time must be in UTC.', example='2019-01-23T12:35:12Z'),
}

model DescribeVodDomainBpsDataByLayerResponseBody = {
  bpsDataInterval?: {
    dataModule?: [ 
    {
      timeStamp?: string(name='TimeStamp', description='The timestamp of the data returned. The time follows the ISO 8601 standard in the yyyy-MM-ddThh:mm:ssZ format. The time is displayed in UTC.', example='2024-02-08T10:09:19Z'),
      trafficValue?: long(name='TrafficValue', description='The total traffic. Unit: bytes.', example='1000'),
      value?: double(name='Value', description='The peak bandwidth. Unit: bit/s.', example='75.33'),
    }
  ](name='DataModule')
  }(name='BpsDataInterval', description='The bandwidth returned at each time interval. Unit: bit/s.'),
  dataInterval?: int32(name='DataInterval', description='The time interval between the entries returned. Unit: seconds.', example='300'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='25818875-5F78-4A*****F6-D7393642CA58'),
}

model DescribeVodDomainBpsDataByLayerResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeVodDomainBpsDataByLayerResponseBody(name='body'),
}

/**
 * @summary Queries the bandwidth data by protocol.
 *
 * @description You can call this API operation up to 20 times per second per account. If you do not set the StartTime or EndTime parameter, the request returns the data collected in the last 24 hours. If you set both these parameters, the request returns the data collected within the specified time range. Time granularity
 * The time granularity supported by Interval, the maximum time period within which historical data is available, and the data delay vary based on the time range to query, as described in the following table.
 * |Time granularity|Time range per query|Historical data available|Data delay|
 * |---|---|---|---|
 * |15 minutes|3 days|93 days|15 minutes|
 * |1 hour|31 days|186 days|3 to 4 hours|
 * |1 day|90 days|366 days|4 hours in most cases, not more than 24 hours|
 *
 * @param request DescribeVodDomainBpsDataByLayerRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeVodDomainBpsDataByLayerResponse
 */
async function describeVodDomainBpsDataByLayerWithOptions(request: DescribeVodDomainBpsDataByLayerRequest, runtime: $RuntimeOptions): DescribeVodDomainBpsDataByLayerResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.domainName)) {
    query['DomainName'] = request.domainName;
  }
  if (!$isNull(request.endTime)) {
    query['EndTime'] = request.endTime;
  }
  if (!$isNull(request.interval)) {
    query['Interval'] = request.interval;
  }
  if (!$isNull(request.ispNameEn)) {
    query['IspNameEn'] = request.ispNameEn;
  }
  if (!$isNull(request.layer)) {
    query['Layer'] = request.layer;
  }
  if (!$isNull(request.locationNameEn)) {
    query['LocationNameEn'] = request.locationNameEn;
  }
  if (!$isNull(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!$isNull(request.startTime)) {
    query['StartTime'] = request.startTime;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'DescribeVodDomainBpsDataByLayer',
    version = '2017-03-21',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Queries the bandwidth data by protocol.
 *
 * @description You can call this API operation up to 20 times per second per account. If you do not set the StartTime or EndTime parameter, the request returns the data collected in the last 24 hours. If you set both these parameters, the request returns the data collected within the specified time range. Time granularity
 * The time granularity supported by Interval, the maximum time period within which historical data is available, and the data delay vary based on the time range to query, as described in the following table.
 * |Time granularity|Time range per query|Historical data available|Data delay|
 * |---|---|---|---|
 * |15 minutes|3 days|93 days|15 minutes|
 * |1 hour|31 days|186 days|3 to 4 hours|
 * |1 day|90 days|366 days|4 hours in most cases, not more than 24 hours|
 *
 * @param request DescribeVodDomainBpsDataByLayerRequest
 * @return DescribeVodDomainBpsDataByLayerResponse
 */
async function describeVodDomainBpsDataByLayer(request: DescribeVodDomainBpsDataByLayerRequest): DescribeVodDomainBpsDataByLayerResponse {
  var runtime = new $RuntimeOptions{};
  return describeVodDomainBpsDataByLayerWithOptions(request, runtime);
}

model DescribeVodDomainCertificateInfoRequest {
  domainName?: string(name='DomainName', description='The accelerated domain name.

This parameter is required.', example='example.com'),
  ownerId?: long(name='OwnerId'),
}

model DescribeVodDomainCertificateInfoResponseBody = {
  certInfos?: {
    certInfo?: [ 
    {
      certDomainName?: string(name='CertDomainName', description='The domain name that matches the certificate.', example='example.com'),
      certExpireTime?: string(name='CertExpireTime', description='The time at which the certificate expires. The time is in the *yyyy-MM-dd*T*HH:mm:ss*Z format. The time is displayed in UTC.', example='2018-06-03T13:03:39Z'),
      certId?: string(name='CertId', description='The ID of the certificate.', example='13227737-cn-hangzhou'),
      certLife?: string(name='CertLife', description='The validity period of the certificate. Unit: months or years.', example='3 months'),
      certName?: string(name='CertName', description='The certificate name.', example='cert-example.com'),
      certOrg?: string(name='CertOrg', description='The certificate authority (CA) that issued the certificate.', example='Let\\\\"s Encrypt'),
      certRegion?: string(name='CertRegion', description='The region where the certificate is used.', example='cn-hangzhou'),
      certStartTime?: string(name='CertStartTime', description='The time when the certificate became effective.', example='2023-04-26T20:23:38Z'),
      certType?: string(name='CertType', description='The type of the certificate. Valid values:

*   **free**: a free certificate.
*   **cas**: a certificate that is purchased from Certificate Management Service.
*   **upload**: a user-uploaded certificate.', example='free'),
      certUpdateTime?: string(name='CertUpdateTime', description='The time at which the certificate was updated.', example='2023-04-26T20:23:38Z'),
      domainCnameStatus?: string(name='DomainCnameStatus', description='The CNAME status of the domain name.

*   **ok**: The domain name points to the CNAME assigned by Alibaba Cloud CDN.
*   **cname_error**: An error occurred and the domain name cannot point to the CNAME.
*   **op_domain_cname_error** : An error occurred to the CNAME of the top-level domain. The domain name cannot point to the CNAME.
*   **unsupport_wildcard**: The wildcard domain name is not supported.', example='ok'),
      domainName?: string(name='DomainName', description='The accelerated domain name whose ICP filing status you want to update.', example='example.com'),
      serverCertificate?: string(name='ServerCertificate', description='The public key of the certificate.', example='****'),
      serverCertificateStatus?: string(name='ServerCertificateStatus', description='The status of the SSL certificate.

*   **on**
*   **off**', example='checking'),
      status?: string(name='Status', description='The status of the certificate.

*   **success**: The certificate is in effect.
*   **checking**: The system is checking whether the domain name is added to ApsaraVideo VOD.
*   **cname_error**: The domain name is not added to ApsaraVideo VOD.
*   **domain_invalid**: The domain name contains invalid characters.
*   **unsupport_wildcard**: The domain name is a wildcard domain name. Wildcard domain names are not supported.
*   **applying**: The certificate application is in progress.
*   **failed**: The certificate application failed.

>  A value is returned for this parameter only when you set `CertType` to `free`. Otherwise, an empty value is returned for this parameter.', example='success'),
    }
  ](name='CertInfo')
  }(name='CertInfos', description='The certificate information.'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='5C1E43DC-9E51-4771-****-7D5ECEB547A1'),
}

model DescribeVodDomainCertificateInfoResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeVodDomainCertificateInfoResponseBody(name='body'),
}

/**
 * @summary Queries the certificate information about an accelerated domain name.
 *
 * @description This operation is available only in the **China (Shanghai)** region.
 *
 * @param request DescribeVodDomainCertificateInfoRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeVodDomainCertificateInfoResponse
 */
async function describeVodDomainCertificateInfoWithOptions(request: DescribeVodDomainCertificateInfoRequest, runtime: $RuntimeOptions): DescribeVodDomainCertificateInfoResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.domainName)) {
    query['DomainName'] = request.domainName;
  }
  if (!$isNull(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'DescribeVodDomainCertificateInfo',
    version = '2017-03-21',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Queries the certificate information about an accelerated domain name.
 *
 * @description This operation is available only in the **China (Shanghai)** region.
 *
 * @param request DescribeVodDomainCertificateInfoRequest
 * @return DescribeVodDomainCertificateInfoResponse
 */
async function describeVodDomainCertificateInfo(request: DescribeVodDomainCertificateInfoRequest): DescribeVodDomainCertificateInfoResponse {
  var runtime = new $RuntimeOptions{};
  return describeVodDomainCertificateInfoWithOptions(request, runtime);
}

model DescribeVodDomainConfigsRequest {
  domainName?: string(name='DomainName', description='The domain name for CDN.

This parameter is required.', example='www.example.com'),
  functionNames?: string(name='FunctionNames', description='The feature name. Separate multiple names with commas (,). For more information, see **Feature description**.

This parameter is required.', example='filetype_based_ttl_set,set_req_host_header'),
  ownerId?: long(name='OwnerId'),
  securityToken?: string(name='SecurityToken'),
}

model DescribeVodDomainConfigsResponseBody = {
  domainConfigs?: {
    domainConfig?: [ 
    {
      configId?: string(name='ConfigId', description='The configuration ID.', example='5003576'),
      functionArgs?: {
        functionArg?: [ 
        {
          argName?: string(name='ArgName', description='The parameter name.', example='file_type'),
          argValue?: string(name='ArgValue', description='The parameter value.', example='txt'),
        }
      ](name='FunctionArg')
      }(name='FunctionArgs', description='The feature parameters.'),
      functionName?: string(name='FunctionName', description='The feature name.', example='set_req_host_header'),
      status?: string(name='Status', description='The configuration status. Valid values:

*   **success**
*   **testing**
*   **failed**
*   **configuring**', example='success'),
    }
  ](name='DomainConfig')
  }(name='DomainConfigs', description='The configurations of the domain name.'),
  requestId?: string(name='RequestId', description='The request ID.', example='F8AA0364-0FDB-4AD5-****-D69FAB8924ED'),
}

model DescribeVodDomainConfigsResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeVodDomainConfigsResponseBody(name='body'),
}

/**
 * @summary Queries the configurations of a domain name for CDN. You can query the configurations of multiple features at a time.
 *
 * @description > This operation is available only in the **China (Shanghai)** region.
 *
 * @param request DescribeVodDomainConfigsRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeVodDomainConfigsResponse
 */
async function describeVodDomainConfigsWithOptions(request: DescribeVodDomainConfigsRequest, runtime: $RuntimeOptions): DescribeVodDomainConfigsResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.domainName)) {
    query['DomainName'] = request.domainName;
  }
  if (!$isNull(request.functionNames)) {
    query['FunctionNames'] = request.functionNames;
  }
  if (!$isNull(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!$isNull(request.securityToken)) {
    query['SecurityToken'] = request.securityToken;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'DescribeVodDomainConfigs',
    version = '2017-03-21',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Queries the configurations of a domain name for CDN. You can query the configurations of multiple features at a time.
 *
 * @description > This operation is available only in the **China (Shanghai)** region.
 *
 * @param request DescribeVodDomainConfigsRequest
 * @return DescribeVodDomainConfigsResponse
 */
async function describeVodDomainConfigs(request: DescribeVodDomainConfigsRequest): DescribeVodDomainConfigsResponse {
  var runtime = new $RuntimeOptions{};
  return describeVodDomainConfigsWithOptions(request, runtime);
}

model DescribeVodDomainDetailRequest {
  domainName?: string(name='DomainName', description='The domain name for CDN.

This parameter is required.', example='example.com'),
  ownerId?: long(name='OwnerId'),
  securityToken?: string(name='SecurityToken'),
}

model DescribeVodDomainDetailResponseBody = {
  domainDetail?: {
    certName?: string(name='CertName', description='The name of the certificate. The value of this parameter is returned if HTTPS is enabled.', example='testCertName'),
    cname?: string(name='Cname', description='The CNAME that is assigned to the domain name for CDN. You must add a CNAME record in the system of your Domain Name System (DNS) service provider to map the domain name for CDN to the CNAME.', example='example.com.w.alikunlun.net'),
    description?: string(name='Description', description='The description of the domain name for CDN.', example='testDescription'),
    domainName?: string(name='DomainName', description='The domain name for CDN.', example='example.com'),
    domainStatus?: string(name='DomainStatus', description='The status of the domain name for CDN. Value values:
*   **online**: indicates that the domain name is enabled.
*   **offline**: indicates that the domain name is disabled.
*   **configuring**: indicates that the domain name is being configured.
*   **configure_failed**: indicates that the domain name failed to be configured.
*   **checking**: indicates that the domain name is under review.
*   **check_failed**: indicates that the domain name failed the review.', example='online'),
    gmtCreated?: string(name='GmtCreated', description='The time when the domain name for CDN was added. The time follows the ISO 8601 standard in the *yyyy-MM-dd*T*HH:mm:ss*Z format. The time is displayed in UTC.', example='2017-11-27T06:51:26Z'),
    gmtModified?: string(name='GmtModified', description='The last time when the domain name for CDN was modified. The time follows the ISO 8601 standard in the *yyyy-MM-dd*T*HH:mm:ss*Z format. The time is displayed in UTC.', example='2017-11-27T06:55:26Z'),
    SSLProtocol?: string(name='SSLProtocol', description='Indicates whether the Secure Sockets Layer (SSL) certificate is enabled. Valid values:
*   **on**: indicates that the SSL certificate is enabled.
*   **off**: indicates that the SSL certificate is disabled.', example='on'),
    SSLPub?: string(name='SSLPub', description='The public key of the certificate. The value of this parameter is returned if HTTPS is enabled.', example='yourSSLPub'),
    scope?: string(name='Scope', description='This parameter is applicable to users of level 3 or higher in mainland China and users outside mainland China. Valid values:
*   **domestic**: mainland China. This is the default value.
*   **overseas**: outside mainland China.
*   **global**: regions in and outside mainland China.', example='domestic'),
    sources?: {
      source?: [ 
      {
        content?: string(name='Content', description='The address of the origin server.', example='****.oss-cn-hangzhou.aliyuncs.com'),
        enabled?: string(name='Enabled', description='The status of the origin server. Valid values:
*   **online**: indicates that the origin server is enabled.
*   **offline**: indicates that the origin server is disabled.', example='online'),
        port?: int32(name='Port', description='The port number. Valid values: 443 and 80.', example='80'),
        priority?: string(name='Priority', description='The priority of the origin server.', example='50'),
        type?: string(name='Type', description='The type of the origin server. Valid values:
*   **ipaddr**: a server that you can access by using an IP address.
*   **domain**: a server that you can access by using a domain name.
*   **oss**: the URL of an Object Storage Service (OSS) bucket.', example='oss'),
        weight?: string(name='Weight', description='The weight of the origin server if multiple origin servers have been specified.', example='10'),
      }
    ](name='Source')
    }(name='Sources', description='The information about the origin server.'),
    weight?: string(name='Weight', description='The weight of the origin server.', example='1'),
  }(name='DomainDetail', description='The basic information about the domain name for CDN.'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='09ABE829-6CD3-4FE0-556113E2****'),
}

model DescribeVodDomainDetailResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeVodDomainDetailResponseBody(name='body'),
}

/**
 * @summary Queries the basic information about a specified domain name for CDN.
 *
 * @description > This operation is available only in the **China (Shanghai)** region.
 *
 * @param request DescribeVodDomainDetailRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeVodDomainDetailResponse
 */
async function describeVodDomainDetailWithOptions(request: DescribeVodDomainDetailRequest, runtime: $RuntimeOptions): DescribeVodDomainDetailResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.domainName)) {
    query['DomainName'] = request.domainName;
  }
  if (!$isNull(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!$isNull(request.securityToken)) {
    query['SecurityToken'] = request.securityToken;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'DescribeVodDomainDetail',
    version = '2017-03-21',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Queries the basic information about a specified domain name for CDN.
 *
 * @description > This operation is available only in the **China (Shanghai)** region.
 *
 * @param request DescribeVodDomainDetailRequest
 * @return DescribeVodDomainDetailResponse
 */
async function describeVodDomainDetail(request: DescribeVodDomainDetailRequest): DescribeVodDomainDetailResponse {
  var runtime = new $RuntimeOptions{};
  return describeVodDomainDetailWithOptions(request, runtime);
}

model DescribeVodDomainHitRateDataRequest {
  domainName?: string(name='DomainName', description='The accelerated domain name.

*   If you leave this parameter empty, the merged data of all your accelerated domain names is returned.
*   You can specify multiple domain names and separate them with commas (,). You can specify a maximum of 500 domain names in each call.
*   To obtain the accelerated domain name, perform the following steps: Log on to the [ApsaraVideo VOD console](https://vod.console.aliyun.com). In the left-side navigation pane, choose **Configuration Management > CDN Configuration > Domain Names**. On the Domain Names page, view the accelerated domain names. Alternatively, you can call the [DescribeVodUserDomains](~~DescribeVodUserDomains~~) operation to query the accelerated domain names.', example='example.com'),
  endTime?: string(name='EndTime', description='The end of the time range to query.

Specify the time in the ISO 8601 standard in the yyyy-MM-ddTHH:mm:ssZ format. The time must be in UTC.

>  The end time must be later than the start time.', example='2024-01-20T14:59:58Z'),
  interval?: string(name='Interval', description='The time granularity. Unit: seconds. Valid values: **300**, **3600**, and **86400**. If you leave this parameter empty or specify an invalid value, the default value is used. The supported time granularity varies based on the time range specified by `EndTime` and `StartTime`. The following content describes the supported time granularity.

*   Time range per query < 3 days: **300** (default), **3600**, and **86400**
*   3 days ≤ Time range per query < 31 days: **3600** (default) and **86400**
*   31 days ≤ Time range per query ≤ 90 days: **86400** (default)', example='300'),
  ownerId?: long(name='OwnerId'),
  startTime?: string(name='StartTime', description='The beginning of the time range to query. Specify the time in the ISO 8601 standard in the yyyy-MM-ddTHH:mm:ssZ format. The time must be in UTC.', example='2024-01-20T13:59:58Z'),
}

model DescribeVodDomainHitRateDataResponseBody = {
  dataInterval?: string(name='DataInterval', description='The time interval at which data is returned, which is the time granularity. Unit: seconds.', example='300'),
  domainName?: string(name='DomainName', description='The accelerated domain name.', example='example.com'),
  endTime?: string(name='EndTime', description='The end of the time range.', example='2024-01-20T14:59:58Z'),
  hitRateInterval?: {
    dataModule?: [ 
    {
      httpsValue?: string(name='HttpsValue', description='The HTTPS byte hit rate.', example='50'),
      timeStamp?: string(name='TimeStamp', description='The timestamp of the data returned. The time follows the ISO 8601 standard in the yyyy-MM-ddThh:mm:ssZ format. The time is displayed in UTC.', example='2024-01-20T13:59:58Z'),
      value?: string(name='Value', description='The total byte hit rate.', example='100'),
    }
  ](name='DataModule')
  }(name='HitRateInterval', description='The byte hit rate data at each time interval.'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='D94E471F-1A27-442E-552D-D4D2000C****'),
  startTime?: string(name='StartTime', description='The beginning of the time range.', example='2024-01-20T13:59:58Z'),
}

model DescribeVodDomainHitRateDataResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeVodDomainHitRateDataResponseBody(name='body'),
}

/**
 * @summary Queries the byte hit ratios of accelerated domain names. Byte hit ratios are measured in percentage.
 *
 * @description * This operation is supported only in the **China (Shanghai)** region.
 * * You can specify a maximum of 500 accelerated domain names.
 * * If you specify neither `StartTime` nor `EndTime`, the data of the last 24 hours is queried. You can specify both `StartTime` and `EndTime` parameters to query data of a specified time range.
 * **Time granularity**
 * The time granularity varies with the time range specified by the `StartTime` and `EndTime` parameters. The following table describes the time period within which historical data is available and the data delay when you do not set `Interval`.
 * |Time granularity|Time range per query|Historical data available|Data delay|
 * |---|---|---|---|
 * |5 minutes|Time range per query &#x3C; 3 days|93 days|15 minutes|
 * |1 hour|3 days ≤ Time range per query &#x3C; 31 days|186 days|3 to 4 hours|
 * |1 day|31 days ≤ Time span of a single query ≤ 366 days|366 days|4 hours in most cases, not more than 24 hours|
 *
 * @param request DescribeVodDomainHitRateDataRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeVodDomainHitRateDataResponse
 */
async function describeVodDomainHitRateDataWithOptions(request: DescribeVodDomainHitRateDataRequest, runtime: $RuntimeOptions): DescribeVodDomainHitRateDataResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.domainName)) {
    query['DomainName'] = request.domainName;
  }
  if (!$isNull(request.endTime)) {
    query['EndTime'] = request.endTime;
  }
  if (!$isNull(request.interval)) {
    query['Interval'] = request.interval;
  }
  if (!$isNull(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!$isNull(request.startTime)) {
    query['StartTime'] = request.startTime;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'DescribeVodDomainHitRateData',
    version = '2017-03-21',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Queries the byte hit ratios of accelerated domain names. Byte hit ratios are measured in percentage.
 *
 * @description * This operation is supported only in the **China (Shanghai)** region.
 * * You can specify a maximum of 500 accelerated domain names.
 * * If you specify neither `StartTime` nor `EndTime`, the data of the last 24 hours is queried. You can specify both `StartTime` and `EndTime` parameters to query data of a specified time range.
 * **Time granularity**
 * The time granularity varies with the time range specified by the `StartTime` and `EndTime` parameters. The following table describes the time period within which historical data is available and the data delay when you do not set `Interval`.
 * |Time granularity|Time range per query|Historical data available|Data delay|
 * |---|---|---|---|
 * |5 minutes|Time range per query &#x3C; 3 days|93 days|15 minutes|
 * |1 hour|3 days ≤ Time range per query &#x3C; 31 days|186 days|3 to 4 hours|
 * |1 day|31 days ≤ Time span of a single query ≤ 366 days|366 days|4 hours in most cases, not more than 24 hours|
 *
 * @param request DescribeVodDomainHitRateDataRequest
 * @return DescribeVodDomainHitRateDataResponse
 */
async function describeVodDomainHitRateData(request: DescribeVodDomainHitRateDataRequest): DescribeVodDomainHitRateDataResponse {
  var runtime = new $RuntimeOptions{};
  return describeVodDomainHitRateDataWithOptions(request, runtime);
}

model DescribeVodDomainLogRequest {
  domainName?: string(name='DomainName', description='The domain name for CDN.

>  You can specify only one domain name in each query.

This parameter is required.', example='example.com'),
  endTime?: string(name='EndTime', description='The end of the time range to query. The end time must be later than the start time. The maximum time range that can be specified is one year. Specify the time in the ISO 8601 standard in the `yyyy-MM-ddTHH:mm:ssZ` format. The time must be in UTC.', example='2016-10-20T05:00:00Z'),
  ownerId?: long(name='OwnerId'),
  pageNumber?: long(name='PageNumber', description='The page number. Default value: **1**.', example='1'),
  pageSize?: long(name='PageSize', description='The number of entries per page.

*   Default value: **300**.
*   Valid values: **1 to 1000**.', example='300'),
  startTime?: string(name='StartTime', description='The beginning of the time range to query. Specify the time in the ISO 8601 standard in the `yyyy-MM-ddTHH:mm:ssZ` format. The time must be in UTC.', example='2016-10-20T04:00:00Z'),
}

model DescribeVodDomainLogResponseBody = {
  domainLogDetails?: {
    domainLogDetail?: [ 
    {
      domainName?: string(name='DomainName', description='The domain name.', example='example.com'),
      logCount?: long(name='LogCount', description='The total number of entries returned on the current page.', example='2'),
      logInfos?: {
        logInfoDetail?: [ 
        {
          endTime?: string(name='EndTime', description='The end of the time range during which data was queried. The time follows the ISO 8601 standard in the `yyyy-MM-ddTHH:mm:ssZ` format. The time is displayed in UTC.', example='2018-05-31T05:00:00Z'),
          logName?: string(name='LogName', description='The name of the log file.', example='example.com_2018_03_25_180000_19****.gz'),
          logPath?: string(name='LogPath', description='The path of the log file.', example='example.com/2018_03_25/example.com_2018_03_25_180000_19****.gz?Expires=1522659931&OSSAccessKeyId=****&Signature=****'),
          logSize?: long(name='LogSize', description='The size of the log file.', example='2645401'),
          startTime?: string(name='StartTime', description='The beginning of the time range during which data was queried. The time follows the ISO 8601 standard in the `yyyy-MM-ddTHH:mm:ssZ` format. The time is displayed in UTC.', example='2018-05-31T04:00:00Z'),
        }
      ](name='LogInfoDetail')
      }(name='LogInfos', description='The queried CDN logs.'),
      pageInfos?: {
        pageNumber?: long(name='PageNumber', description='The page number.', example='1'),
        pageSize?: long(name='PageSize', description='The number of entries per page.', example='300'),
        total?: long(name='Total', description='The total number of entries returned.', example='2'),
      }(name='PageInfos', description='The pagination information.'),
    }
  ](name='DomainLogDetail')
  }(name='DomainLogDetails', description='The details of CDN logs.'),
  requestId?: string(name='RequestId', description='The request ID.', example='077D0284-F041-4A41-4D3C-B48377FD****'),
}

model DescribeVodDomainLogResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeVodDomainLogResponseBody(name='body'),
}

/**
 * @summary Queries the information about the CDN access logs for a domain name, including the log path.
 *
 * @description *   This operation is available only in the **China (Shanghai)** region.
 * *   For more information about the log format and latency, see [Download logs](https://help.aliyun.com/document_detail/86099.html).
 * *   If you specify neither the StartTime parameter nor the EndTime parameter, the log data in the last 24 hours is queried.
 * *   You can specify both the StartTime and EndTime parameters to query the log data that is generated in the specified time range.
 *
 * @param request DescribeVodDomainLogRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeVodDomainLogResponse
 */
async function describeVodDomainLogWithOptions(request: DescribeVodDomainLogRequest, runtime: $RuntimeOptions): DescribeVodDomainLogResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.domainName)) {
    query['DomainName'] = request.domainName;
  }
  if (!$isNull(request.endTime)) {
    query['EndTime'] = request.endTime;
  }
  if (!$isNull(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!$isNull(request.pageNumber)) {
    query['PageNumber'] = request.pageNumber;
  }
  if (!$isNull(request.pageSize)) {
    query['PageSize'] = request.pageSize;
  }
  if (!$isNull(request.startTime)) {
    query['StartTime'] = request.startTime;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'DescribeVodDomainLog',
    version = '2017-03-21',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Queries the information about the CDN access logs for a domain name, including the log path.
 *
 * @description *   This operation is available only in the **China (Shanghai)** region.
 * *   For more information about the log format and latency, see [Download logs](https://help.aliyun.com/document_detail/86099.html).
 * *   If you specify neither the StartTime parameter nor the EndTime parameter, the log data in the last 24 hours is queried.
 * *   You can specify both the StartTime and EndTime parameters to query the log data that is generated in the specified time range.
 *
 * @param request DescribeVodDomainLogRequest
 * @return DescribeVodDomainLogResponse
 */
async function describeVodDomainLog(request: DescribeVodDomainLogRequest): DescribeVodDomainLogResponse {
  var runtime = new $RuntimeOptions{};
  return describeVodDomainLogWithOptions(request, runtime);
}

model DescribeVodDomainMax95BpsDataRequest {
  cycle?: string(name='Cycle', description='The cycle to query the 95th percentile bandwidth data. Valid values:

*   day (default)
*   month', example='month'),
  domainName?: string(name='DomainName', description='The domain name to be queried for acceleration. If the parameter is empty, the data merged from all accelerated domain names will be returned by default.

> Batch domain name queries are not supported.', example='example.com'),
  endTime?: string(name='EndTime', description='End time point. The date format follows the ISO8601 representation and uses UTC time, in the format yyyy-MM-dd\\\\"T\\\\"HH:mm:ssZ.', example='2017-01-12T13:00:00Z'),
  ownerId?: long(name='OwnerId'),
  startTime?: string(name='StartTime', description='Start time point. The date format follows the ISO8601 representation and uses UTC time, in the format yyyy-MM-dd\\\\"T\\\\"HH:mm:ssZ.', example='2017-01-11T12:00:00Z'),
  timePoint?: string(name='TimePoint', description='The start time point for getting the data. The date format follows the ISO8601 representation and uses UTC time, in the format yyyy-MM-dd\\\\"T\\\\"HH:mm:ssZ.', example='2017-12-21T10:00:00Z'),
}

model DescribeVodDomainMax95BpsDataResponseBody = {
  detailData?: {
    max95Detail?: [ 
    {
      area?: string(name='Area', description='The billable region where the peak 95 data was collected.', example='CN'),
      max95Bps?: float(name='Max95Bps', description='The 95th percentile bandwidth.', example='16777590.28'),
      max95BpsPeakTime?: string(name='Max95BpsPeakTime', description='The time corresponding to the 95th percentile bandwidth peak.', example='2015-12-11T21:05:00Z'),
      timeStamp?: string(name='TimeStamp', description='The timestamp of the returned data.', example='2024-01-18 10:11:32'),
    }
  ](name='Max95Detail')
  }(name='DetailData', description='Details of the 95th percentile bandwidth.'),
  domainName?: string(name='DomainName', description='The domain name for CDN.', example='example.com'),
  domesticMax95Bps?: string(name='DomesticMax95Bps', description='The 95th percentile bandwidth in the Chinese mainland.', example='16777590.28'),
  endTime?: string(name='EndTime', description='The end of the time range to query.

Specify the time in the ISO 8601 standard in the yyyy-MM-ddTHH:mm:ssZ format. The time must be in UTC.

>  The end time must be later than the start time.', example='2017-01-11T13:00:00Z'),
  max95Bps?: string(name='Max95Bps', description='The 95th percentile bandwidth.', example='16777590.28'),
  overseasMax95Bps?: string(name='OverseasMax95Bps', description='The 95th percentile bandwidth outside the Chinese mainland.', example='0'),
  requestId?: string(name='RequestId', description='The request ID.', example='25818875-5F78-4A*****F6-D7393642CA58'),
  startTime?: string(name='StartTime', description='The beginning of the time range to query.

Specify the time in the ISO 8601 standard in the yyyy-MM-ddTHH:mm:ssZ format. The time must be in UTC.', example='2017-01-11T12:00:00Z'),
}

model DescribeVodDomainMax95BpsDataResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeVodDomainMax95BpsDataResponseBody(name='body'),
}

/**
 * @summary Queries the 95th percentile bandwidth data of an accelerated domain name.
 *
 * @param request DescribeVodDomainMax95BpsDataRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeVodDomainMax95BpsDataResponse
 */
async function describeVodDomainMax95BpsDataWithOptions(request: DescribeVodDomainMax95BpsDataRequest, runtime: $RuntimeOptions): DescribeVodDomainMax95BpsDataResponse {
  request.validate();
  var query = OpenApiUtil.query(request.toMap());
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'DescribeVodDomainMax95BpsData',
    version = '2017-03-21',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'GET',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Queries the 95th percentile bandwidth data of an accelerated domain name.
 *
 * @param request DescribeVodDomainMax95BpsDataRequest
 * @return DescribeVodDomainMax95BpsDataResponse
 */
async function describeVodDomainMax95BpsData(request: DescribeVodDomainMax95BpsDataRequest): DescribeVodDomainMax95BpsDataResponse {
  var runtime = new $RuntimeOptions{};
  return describeVodDomainMax95BpsDataWithOptions(request, runtime);
}

model DescribeVodDomainQpsDataRequest {
  domainName?: string(name='DomainName', description='You can specify multiple domain names and separate them with commas (,). You can specify a maximum of 500 domain names in each call.

By default, this operation queries the number and proportions of HTTP status codes for all accelerated domain names that belong to your Alibaba Cloud account.', example='example.com'),
  endTime?: string(name='EndTime', description='The end of the time range to query. Specify the time in the ISO 8601 standard in the *yyyy-MM-dd**THH:mm:ssZ* format. The time must be in UTC.', example='2024-05-02T15:59:00Z'),
  interval?: string(name='Interval', description='The interval at which to return data. Unit: seconds. Valid values: **300**, **3600**, and **86400**.', example='300'),
  ispNameEn?: string(name='IspNameEn', description='The name of the Internet service provider (ISP). If you leave this parameter empty, data of all ISPs is queried.', example='unicom'),
  locationNameEn?: string(name='LocationNameEn', description='The name of the region. If you leave this parameter empty, data in all regions is queried.', example='beijing'),
  ownerId?: long(name='OwnerId'),
  startTime?: string(name='StartTime', description='The beginning of the time range to query. Specify the time in the ISO 8601 standard in the *yyyy-MM-dd**THH:mm:ssZ* format. The time must be in UTC.', example='2024-05-02T15:50:00Z'),
}

model DescribeVodDomainQpsDataResponseBody = {
  dataInterval?: string(name='DataInterval', description='The time interval between the data entries returned. Unit: seconds.', example='300'),
  domainName?: string(name='DomainName', description='The accelerated domain name.', example='example.com'),
  endTime?: string(name='EndTime', description='The end of the time range during which data was queried. The time follows the ISO 8601 standard in the *YYYY-MM-DD**Thh:mm:ss* format. The time is displayed in UTC.', example='2024-05-02T15:59:00Z'),
  qpsDataInterval?: {
    dataModule?: [ 
    {
      accDomesticValue?: string(name='AccDomesticValue', description='The number of requests in the Chinese mainland.', example='0'),
      accOverseasValue?: string(name='AccOverseasValue', description='The number of requests outside the Chinese mainland.', example='0'),
      accValue?: string(name='AccValue', description='The total number of requests.', example='0'),
      domesticValue?: string(name='DomesticValue', description='The QPS data in the Chinese mainland.', example='0'),
      httpsAccDomesticValue?: string(name='HttpsAccDomesticValue', description='The QPS that is calculated based on the HTTPS requests sent to POPs in the Chinese mainland.', example='1'),
      httpsAccOverseasValue?: string(name='HttpsAccOverseasValue', description='The number of HTTPS requests sent to POPs outside the Chinese mainland.', example='1'),
      httpsAccValue?: string(name='HttpsAccValue', description='The number of HTTPS requests sent to POPs.', example='1'),
      httpsDomesticValue?: string(name='HttpsDomesticValue', description='The QPS that is calculated based on the HTTPS requests sent to POPs in the Chinese mainland.', example='1'),
      httpsOverseasValue?: string(name='HttpsOverseasValue', description='The QPS that is calculated based on the HTTPS requests sent to POPs outside the Chinese mainland.', example='1'),
      httpsValue?: string(name='HttpsValue', description='The QPS that is calculated based on the HTTPS requests sent to points of presence (POPs).', example='1'),
      overseasValue?: string(name='OverseasValue', description='The QPS data outside the Chinese mainland.', example='0'),
      timeStamp?: string(name='TimeStamp', description='The timestamp of the data returned. The time follows the ISO 8601 standard in the YYYY-MM-DDThh:mm:ss format. The time is displayed in UTC.', example='2023-06-27 10:10:58'),
      value?: string(name='Value', description='The total QPS.', example='0'),
    }
  ](name='DataModule')
  }(name='QpsDataInterval', description='The list of QPS records at each interval.'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='25818875-5F78-4AF6-D7393642CA58*****'),
  startTime?: string(name='StartTime', description='The beginning of the time range during which data was queried. The time follows the ISO 8601 standard in the *YYYY-MM-DD**Thh:mm:ss* format. The time is displayed in UTC.', example='2024-05-02T15:50:00Z'),
}

model DescribeVodDomainQpsDataResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeVodDomainQpsDataResponseBody(name='body'),
}

/**
 * @summary Queries the number of queries per second (QPS) for one or more accelerated domain names. Data is collected every 5 minutes. You can query data collected in the last 90 days.
 *
 * @description * This operation is available only in the China (Shanghai) region.
 * * You can call this operation up to 100 times per second per account.
 * * If you do not set the StartTime or EndTime parameter, the request returns the data collected in the last 24 hours. If you set both these parameters, the request returns the data collected within the specified time range.
 * **Time granularity**
 * The time granularity supported by the Interval parameter, the maximum time period within which historical data is available, and the data delay vary with the maximum time range per query, as described in the following table.
 * |Time granularity|Maximum time range per query|Historical data available|Data delay|
 * |---|---|---|---|
 * |5 minutes|3 days|93 days|15 minutes|
 * |1 hour|31 days|186 days|3 to 4 hours|
 * |1 day|366 days|366 days|4 to 24 hours|
 * ---
 *
 * @param request DescribeVodDomainQpsDataRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeVodDomainQpsDataResponse
 */
async function describeVodDomainQpsDataWithOptions(request: DescribeVodDomainQpsDataRequest, runtime: $RuntimeOptions): DescribeVodDomainQpsDataResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.domainName)) {
    query['DomainName'] = request.domainName;
  }
  if (!$isNull(request.endTime)) {
    query['EndTime'] = request.endTime;
  }
  if (!$isNull(request.interval)) {
    query['Interval'] = request.interval;
  }
  if (!$isNull(request.ispNameEn)) {
    query['IspNameEn'] = request.ispNameEn;
  }
  if (!$isNull(request.locationNameEn)) {
    query['LocationNameEn'] = request.locationNameEn;
  }
  if (!$isNull(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!$isNull(request.startTime)) {
    query['StartTime'] = request.startTime;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'DescribeVodDomainQpsData',
    version = '2017-03-21',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Queries the number of queries per second (QPS) for one or more accelerated domain names. Data is collected every 5 minutes. You can query data collected in the last 90 days.
 *
 * @description * This operation is available only in the China (Shanghai) region.
 * * You can call this operation up to 100 times per second per account.
 * * If you do not set the StartTime or EndTime parameter, the request returns the data collected in the last 24 hours. If you set both these parameters, the request returns the data collected within the specified time range.
 * **Time granularity**
 * The time granularity supported by the Interval parameter, the maximum time period within which historical data is available, and the data delay vary with the maximum time range per query, as described in the following table.
 * |Time granularity|Maximum time range per query|Historical data available|Data delay|
 * |---|---|---|---|
 * |5 minutes|3 days|93 days|15 minutes|
 * |1 hour|31 days|186 days|3 to 4 hours|
 * |1 day|366 days|366 days|4 to 24 hours|
 * ---
 *
 * @param request DescribeVodDomainQpsDataRequest
 * @return DescribeVodDomainQpsDataResponse
 */
async function describeVodDomainQpsData(request: DescribeVodDomainQpsDataRequest): DescribeVodDomainQpsDataResponse {
  var runtime = new $RuntimeOptions{};
  return describeVodDomainQpsDataWithOptions(request, runtime);
}

model DescribeVodDomainRealTimeBpsDataRequest {
  domainName?: string(name='DomainName', description='You can specify multiple domain names and separate them with commas (,). You can specify a maximum of 500 domain names in each call.

This parameter is required.', example='example.com'),
  endTime?: string(name='EndTime', description='The end of the time range to query. Specify the time in the ISO 8601 standard in the yyyy-MM-ddTHH:mm:ssZ format. The time must be in UTC.

>  The end time must be later than the start time.', example='2019-11-30T05:40:00Z'),
  ispNameEn?: string(name='IspNameEn', description='The name of the ISP. If you do not set this parameter, all ISPs are queried.', example='telecom'),
  locationNameEn?: string(name='LocationNameEn', description='The name of the region. If you do not set this parameter, data in all regions is queried.', example='shanghai'),
  ownerId?: long(name='OwnerId'),
  startTime?: string(name='StartTime', description='The beginning of the time range to query.

Specify the time in the ISO 8601 standard in the yyyy-MM-ddTHH:mm:ssZ format. The time must be in UTC.', example='2019-11-30T05:33:00Z'),
}

model DescribeVodDomainRealTimeBpsDataResponseBody = {
  data?: {
    bpsModel?: [ 
    {
      bps?: float(name='Bps', description='The bandwidth. Unit: bit/s.', example='16710625.733333332'),
      timeStamp?: string(name='TimeStamp', description='The timestamp of the data returned. The time follows the ISO 8601 standard. The time is displayed in UTC.', example='2019-11-30T05:41:00Z'),
    }
  ](name='BpsModel')
  }(name='Data', description='The returned data.'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='B49E6DDA-F413-422B-B58E-2FA23F286726'),
}

model DescribeVodDomainRealTimeBpsDataResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeVodDomainRealTimeBpsDataResponseBody(name='body'),
}

/**
 * @summary Queries the bandwidth data for one or more accelerated domains. The minimum time granularity is 1 minute. The minimum data latency is 5 minutes. You can query data in the last 186 days. Compared with the DescribeVodDomainBpsData operation, this operation provides a smaller time granularity, lower data latency, and allows you to query historical data within a shorter time period.
 *
 * @description * This operation is supported only in the **China (Shanghai)** region.
 * * You can specify a maximum of 500 accelerated domain names.
 * * If you specify neither `StartTime` nor `EndTime`, the data of the last 1 hour is queried. You can specify both `StartTime` and `EndTime` parameters to query data of a specified time range.
 * **Time granularity**
 * The time granularity varies with the time range specified by the `StartTime` and `EndTime` parameters. The following table describes the time period within which historical data is available and the data delay.
 * |Time granularity|Time range per query|Historical data available|Data delay|
 * |---|---|---|---|
 * |1 minute|Time range per query ≤ 1 hour|7 days|5 minutes|
 * |5 minutes|1 Hour &#x3C; Time range per query ≤ 3 days|93 days|15 minutes|
 * |1 hour|3 days &#x3C; Time range per query ≤ 31 days|186 days|3 to 4 hours|
 *
 * @param request DescribeVodDomainRealTimeBpsDataRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeVodDomainRealTimeBpsDataResponse
 */
async function describeVodDomainRealTimeBpsDataWithOptions(request: DescribeVodDomainRealTimeBpsDataRequest, runtime: $RuntimeOptions): DescribeVodDomainRealTimeBpsDataResponse {
  request.validate();
  var query = OpenApiUtil.query(request.toMap());
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'DescribeVodDomainRealTimeBpsData',
    version = '2017-03-21',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'GET',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Queries the bandwidth data for one or more accelerated domains. The minimum time granularity is 1 minute. The minimum data latency is 5 minutes. You can query data in the last 186 days. Compared with the DescribeVodDomainBpsData operation, this operation provides a smaller time granularity, lower data latency, and allows you to query historical data within a shorter time period.
 *
 * @description * This operation is supported only in the **China (Shanghai)** region.
 * * You can specify a maximum of 500 accelerated domain names.
 * * If you specify neither `StartTime` nor `EndTime`, the data of the last 1 hour is queried. You can specify both `StartTime` and `EndTime` parameters to query data of a specified time range.
 * **Time granularity**
 * The time granularity varies with the time range specified by the `StartTime` and `EndTime` parameters. The following table describes the time period within which historical data is available and the data delay.
 * |Time granularity|Time range per query|Historical data available|Data delay|
 * |---|---|---|---|
 * |1 minute|Time range per query ≤ 1 hour|7 days|5 minutes|
 * |5 minutes|1 Hour &#x3C; Time range per query ≤ 3 days|93 days|15 minutes|
 * |1 hour|3 days &#x3C; Time range per query ≤ 31 days|186 days|3 to 4 hours|
 *
 * @param request DescribeVodDomainRealTimeBpsDataRequest
 * @return DescribeVodDomainRealTimeBpsDataResponse
 */
async function describeVodDomainRealTimeBpsData(request: DescribeVodDomainRealTimeBpsDataRequest): DescribeVodDomainRealTimeBpsDataResponse {
  var runtime = new $RuntimeOptions{};
  return describeVodDomainRealTimeBpsDataWithOptions(request, runtime);
}

model DescribeVodDomainRealTimeByteHitRateDataRequest {
  domainName?: string(name='DomainName', description='You can specify multiple domain names and separate them with commas (,). You can specify at most 100 domain names in each call.

This parameter is required.', example='example.com'),
  endTime?: string(name='EndTime', description='The end of the time range to query.

Specify the time in the ISO 8601 standard in the yyyy-MM-ddTHH:mm:ssZ format. The time must be in UTC.

>  The end time must be later than the start time.', example='2020-05-15T09:15:00Z'),
  ownerId?: long(name='OwnerId'),
  startTime?: string(name='StartTime', description='The beginning of the time range to query.

Specify the time in the ISO 8601 standard in the yyyy-MM-ddTHH:mm:ssZ format. The time must be in UTC.', example='2020-05-15T09:13:00Z'),
}

model DescribeVodDomainRealTimeByteHitRateDataResponseBody = {
  data?: {
    byteHitRateDataModel?: [ 
    {
      byteHitRate?: float(name='ByteHitRate', description='The byte hit ratio in percentage.', example='0.8956940476262277'),
      timeStamp?: string(name='TimeStamp', description='The timestamp of the data returned. The time follows the ISO 8601 standard. The time is displayed in UTC.', example='2020-05-15T09:13:00Z'),
    }
  ](name='ByteHitRateDataModel')
  }(name='Data', description='The returned data.'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='70A26B11-3673-479C-AEA8-E03FC5D3496D'),
}

model DescribeVodDomainRealTimeByteHitRateDataResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeVodDomainRealTimeByteHitRateDataResponseBody(name='body'),
}

/**
 * @summary Queries the byte hit ratio for one or more accelerated domains. The minimum time granularity is 1 minute. The minimum data latency is 5 minutes. You can query data in the last 186 days.
 *
 * @description * This operation is supported only in the **China (Shanghai)** region.
 * * You can specify a maximum of 100 accelerated domain names.
 * * If you specify neither `StartTime` nor `EndTime`, the data of the last 1 hour is queried. You can specify both `StartTime` and `EndTime` parameters to query data of a specified time range.
 * **Time granularity**
 * The time granularity varies with the time range specified by the `StartTime` and `EndTime` parameters. The following table describes the time period within which historical data is available and the data delay.
 * |Time granularity|Time range per query|Historical data available|Data delay|
 * |---|---|---|---|
 * |1 minute|Time range per query ≤ 1 hour|7 days|5 minutes|
 * |5 minutes|1 Hour &#x3C; Time range per query ≤ 3 days|93 days|15 minutes|
 * |1 hour|3 days &#x3C; Time range per query ≤ 31 days|186 days|3 to 4 hours|
 *
 * @param request DescribeVodDomainRealTimeByteHitRateDataRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeVodDomainRealTimeByteHitRateDataResponse
 */
async function describeVodDomainRealTimeByteHitRateDataWithOptions(request: DescribeVodDomainRealTimeByteHitRateDataRequest, runtime: $RuntimeOptions): DescribeVodDomainRealTimeByteHitRateDataResponse {
  request.validate();
  var query = OpenApiUtil.query(request.toMap());
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'DescribeVodDomainRealTimeByteHitRateData',
    version = '2017-03-21',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'GET',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Queries the byte hit ratio for one or more accelerated domains. The minimum time granularity is 1 minute. The minimum data latency is 5 minutes. You can query data in the last 186 days.
 *
 * @description * This operation is supported only in the **China (Shanghai)** region.
 * * You can specify a maximum of 100 accelerated domain names.
 * * If you specify neither `StartTime` nor `EndTime`, the data of the last 1 hour is queried. You can specify both `StartTime` and `EndTime` parameters to query data of a specified time range.
 * **Time granularity**
 * The time granularity varies with the time range specified by the `StartTime` and `EndTime` parameters. The following table describes the time period within which historical data is available and the data delay.
 * |Time granularity|Time range per query|Historical data available|Data delay|
 * |---|---|---|---|
 * |1 minute|Time range per query ≤ 1 hour|7 days|5 minutes|
 * |5 minutes|1 Hour &#x3C; Time range per query ≤ 3 days|93 days|15 minutes|
 * |1 hour|3 days &#x3C; Time range per query ≤ 31 days|186 days|3 to 4 hours|
 *
 * @param request DescribeVodDomainRealTimeByteHitRateDataRequest
 * @return DescribeVodDomainRealTimeByteHitRateDataResponse
 */
async function describeVodDomainRealTimeByteHitRateData(request: DescribeVodDomainRealTimeByteHitRateDataRequest): DescribeVodDomainRealTimeByteHitRateDataResponse {
  var runtime = new $RuntimeOptions{};
  return describeVodDomainRealTimeByteHitRateDataWithOptions(request, runtime);
}

model DescribeVodDomainRealTimeDetailDataRequest {
  domainName?: string(name='DomainName', description='The accelerated domain name. You can specify a maximum of 20 accelerated domain names in each call. Separate domain names with commas (,).

This parameter is required.', example='example.com'),
  endTime?: string(name='EndTime', description='The end of the time range to query.

Specify the time in the ISO 8601 standard in the yyyy-MM-ddTHH:mm:ssZ format. The time must be in UTC. Example: 2019-11-30T05:40:00Z.

This parameter is required.', example='2019-01-23T12:40:00Z'),
  field?: string(name='Field', description='The type of data that you want to query. You can specify multiple data types and separate them with commas (,). Valid values:

qps: the number of queries per second bps: bandwidth data http_code: HTTP status codes

This parameter is required.', example='bps'),
  ispNameEn?: string(name='IspNameEn', description='The name of the Internet service provider (ISP).', example='unicom'),
  locationNameEn?: string(name='LocationNameEn', description='The name of the region. If you do not specify a region, data in all regions is queried.', example='shanghai'),
  merge?: string(name='Merge', description='Specifies whether to return a summary value. Valid values:

true false (default)', example='false'),
  mergeLocIsp?: string(name='MergeLocIsp', description='Specifies whether to return a summary value. Valid values:

*   **true**: groups the results by domain name and merges the results by region and ISP.
*   **false**: groups the results by domain name.

Default value: **false**.', example='true'),
  ownerId?: long(name='OwnerId'),
  startTime?: string(name='StartTime', description='The beginning of the time range to query.

Specify the time in the ISO 8601 standard in the yyyy-MM-ddTHH:mm:ssZ format. The time must be in UTC. Example: 2019-11-30T05:33:00Z.

This parameter is required.', example='2019-01-23T12:35:12Z'),
}

model DescribeVodDomainRealTimeDetailDataResponseBody = {
  data?: string(name='Data', description='The returned results.', example='[
      {
            "time_stp": "2018-06-05T20:00:00Z",
            "domain_name": "example.com",
            "location": "Guangdong",
            "isp": "telecom",
            "qps": 10
      },
      {
            "time_stp": "2018-06-05T20:00:00Z",
            "domain_name": "example.com",
            "location": "Jiangsu",
            "isp": "unicom",
            "qps": 11.1
      }
]'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='1710298E-8AFA-5F6D-A3E9-47103C52177D'),
}

model DescribeVodDomainRealTimeDetailDataResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeVodDomainRealTimeDetailDataResponseBody(name='body'),
}

/**
 * @summary Queries real-time monitoring data of one or more accelerated domain names.
 *
 * @description You can query data within the last seven days. Data is collected every minute. You can call this API operation up to 10 times per second per account.
 *
 * @param request DescribeVodDomainRealTimeDetailDataRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeVodDomainRealTimeDetailDataResponse
 */
async function describeVodDomainRealTimeDetailDataWithOptions(request: DescribeVodDomainRealTimeDetailDataRequest, runtime: $RuntimeOptions): DescribeVodDomainRealTimeDetailDataResponse {
  request.validate();
  var query = OpenApiUtil.query(request.toMap());
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'DescribeVodDomainRealTimeDetailData',
    version = '2017-03-21',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'GET',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Queries real-time monitoring data of one or more accelerated domain names.
 *
 * @description You can query data within the last seven days. Data is collected every minute. You can call this API operation up to 10 times per second per account.
 *
 * @param request DescribeVodDomainRealTimeDetailDataRequest
 * @return DescribeVodDomainRealTimeDetailDataResponse
 */
async function describeVodDomainRealTimeDetailData(request: DescribeVodDomainRealTimeDetailDataRequest): DescribeVodDomainRealTimeDetailDataResponse {
  var runtime = new $RuntimeOptions{};
  return describeVodDomainRealTimeDetailDataWithOptions(request, runtime);
}

model DescribeVodDomainRealTimeHttpCodeDataRequest {
  domainName?: string(name='DomainName', description='The accelerated domain name.

*   You can specify multiple domain names and separate them with commas (,). You can specify at most 100 domain names in each call.
*   If you specify multiple domain names, merged data is returned.
*   To obtain the accelerated domain name, perform the following steps: Log on to the [ApsaraVideo VOD console](https://vod.console.aliyun.com). In the left-side navigation pane, choose **Configuration Management > CDN Configuration > Domain Names**. On the Domain Names page, view the accelerated domain names. Alternatively, you can call the [DescribeVodUserDomains](~~DescribeVodUserDomains~~) operation to query the accelerated domain names.

This parameter is required.', example='example.com'),
  endTime?: string(name='EndTime', description='The end of the time range to query.

Specify the time in the ISO 8601 standard in the yyyy-MM-ddTHH:mm:ssZ format. The time must be in UTC.

>  The end time must be later than the start time.', example='2019-11-30T05:40:00Z'),
  ispNameEn?: string(name='IspNameEn', description='The name of the ISP. If you do not set this parameter, all ISPs are queried.', example='unicom'),
  locationNameEn?: string(name='LocationNameEn', description='The name of the region. If you do not set this parameter, data in all regions is queried.', example='shanghai'),
  ownerId?: long(name='OwnerId'),
  startTime?: string(name='StartTime', description='The beginning of the time range to query.

Specify the time in the ISO 8601 standard in the yyyy-MM-ddTHH:mm:ssZ format. The time must be in UTC.', example='2019-11-30T05:39:00Z'),
}

model DescribeVodDomainRealTimeHttpCodeDataResponseBody = {
  dataInterval?: string(name='DataInterval', description='The time interval at which data is returned. Unit: seconds.

The returned value varies based on the time range per query. Valid values: 60 (1 minute), 300 (5 minutes), and 3600 (1 hour). For more information, see the **Time granularity** section in the **API documentation**.', example='60'),
  domainName?: string(name='DomainName', description='The accelerated domain name.', example='example.com'),
  endTime?: string(name='EndTime', description='The end of the time range.', example='2019-11-30T05:40:00Z'),
  realTimeHttpCodeData?: {
    usageData?: [ 
    {
      timeStamp?: string(name='TimeStamp', description='The timestamp of the data returned. The time follows the ISO 8601 standard in the yyyy-MM-ddThh:mm:ssZ format. The time is displayed in UTC.', example='2019-11-30T05:39:00Z'),
      value?: {
        realTimeCodeProportionData?: [ 
        {
          code?: string(name='Code', description='The HTTP status code.', example='500'),
          count?: string(name='Count', description='The number of the HTTP status codes.', example='100'),
          proportion?: string(name='Proportion', description='The proportion of the HTTP status code in percentage.', example='28.4496124031008'),
        }
      ](name='RealTimeCodeProportionData')
      }(name='Value', description='The proportion of each HTTP status code is displayed in a data list.'),
    }
  ](name='UsageData')
  }(name='RealTimeHttpCodeData', description='The proportion of each HTTP status code in each time interval.'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='BC858082-736F-4A25-867B-E5B67C85ACF7'),
  startTime?: string(name='StartTime', description='The beginning of the time range.', example='2019-11-30T05:39:00Z'),
}

model DescribeVodDomainRealTimeHttpCodeDataResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeVodDomainRealTimeHttpCodeDataResponseBody(name='body'),
}

/**
 * @summary Queries the total number of HTTP status codes and proportion of each HTTP status code for one or more accelerated domains. The minimum time granularity is 1 minute. The minimum data latency is 5 minutes. You can query data in the last 186 days.
 *
 * @description * This operation is supported only in the **China (Shanghai)** region.
 * * You can specify a maximum of 100 accelerated domain names.
 * * If you specify neither `StartTime` nor `EndTime`, the data of the last 1 hour is queried. You can specify both `StartTime` and `EndTime` parameters to query data of a specified time range.
 * **Time granularity**
 * The time granularity varies with the time range specified by the `StartTime` and `EndTime` parameters. The following table describes the time period within which historical data is available and the data delay.
 * |Time granularity|Time range per query|Historical data available (days)|Data latency|
 * |---|---|---|---|
 * |1 minute|Time range per query ≤ 1 hour|7 days|5 minutes|
 * |5 minutes|1 hour &#x3C; Time range per query &#x3C; 3 days|93 days|15 minutes|
 * |1 hour|3 days ≤ Time range per query &#x3C; 31 days|186 days|3 to 4 hours|
 *
 * @param request DescribeVodDomainRealTimeHttpCodeDataRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeVodDomainRealTimeHttpCodeDataResponse
 */
async function describeVodDomainRealTimeHttpCodeDataWithOptions(request: DescribeVodDomainRealTimeHttpCodeDataRequest, runtime: $RuntimeOptions): DescribeVodDomainRealTimeHttpCodeDataResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.domainName)) {
    query['DomainName'] = request.domainName;
  }
  if (!$isNull(request.endTime)) {
    query['EndTime'] = request.endTime;
  }
  if (!$isNull(request.ispNameEn)) {
    query['IspNameEn'] = request.ispNameEn;
  }
  if (!$isNull(request.locationNameEn)) {
    query['LocationNameEn'] = request.locationNameEn;
  }
  if (!$isNull(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!$isNull(request.startTime)) {
    query['StartTime'] = request.startTime;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'DescribeVodDomainRealTimeHttpCodeData',
    version = '2017-03-21',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Queries the total number of HTTP status codes and proportion of each HTTP status code for one or more accelerated domains. The minimum time granularity is 1 minute. The minimum data latency is 5 minutes. You can query data in the last 186 days.
 *
 * @description * This operation is supported only in the **China (Shanghai)** region.
 * * You can specify a maximum of 100 accelerated domain names.
 * * If you specify neither `StartTime` nor `EndTime`, the data of the last 1 hour is queried. You can specify both `StartTime` and `EndTime` parameters to query data of a specified time range.
 * **Time granularity**
 * The time granularity varies with the time range specified by the `StartTime` and `EndTime` parameters. The following table describes the time period within which historical data is available and the data delay.
 * |Time granularity|Time range per query|Historical data available (days)|Data latency|
 * |---|---|---|---|
 * |1 minute|Time range per query ≤ 1 hour|7 days|5 minutes|
 * |5 minutes|1 hour &#x3C; Time range per query &#x3C; 3 days|93 days|15 minutes|
 * |1 hour|3 days ≤ Time range per query &#x3C; 31 days|186 days|3 to 4 hours|
 *
 * @param request DescribeVodDomainRealTimeHttpCodeDataRequest
 * @return DescribeVodDomainRealTimeHttpCodeDataResponse
 */
async function describeVodDomainRealTimeHttpCodeData(request: DescribeVodDomainRealTimeHttpCodeDataRequest): DescribeVodDomainRealTimeHttpCodeDataResponse {
  var runtime = new $RuntimeOptions{};
  return describeVodDomainRealTimeHttpCodeDataWithOptions(request, runtime);
}

model DescribeVodDomainRealTimeQpsDataRequest {
  domainName?: string(name='DomainName', description='You can specify multiple domain names and separate them with commas (,). You can specify a maximum of 500 domain names in each call.

This parameter is required.', example='example.com'),
  endTime?: string(name='EndTime', description='The end of the time range to query.

Specify the time in the ISO 8601 standard in the yyyy-MM-ddTHH:mm:ssZ format. The time must be in UTC.

>  The end time must be later than the start time.', example='2019-12-02T11:26:00Z'),
  ispNameEn?: string(name='IspNameEn', description='The name of the Internet service provider (ISP). If you do not set this parameter, all ISPs are queried.', example='unicom'),
  locationNameEn?: string(name='LocationNameEn', description='The name of the region. If you do not set this parameter, data in all regions is queried.', example='shanghai'),
  ownerId?: long(name='OwnerId'),
  startTime?: string(name='StartTime', description='The beginning of the time range to query.

Specify the time in the ISO 8601 standard in the yyyy-MM-ddTHH:mm:ssZ format. The time must be in UTC.', example='2019-12-02T11:25:00Z'),
}

model DescribeVodDomainRealTimeQpsDataResponseBody = {
  data?: {
    qpsModel?: [ 
    {
      qps?: float(name='Qps', description='The number of queries per second.', example='1851.25'),
      timeStamp?: string(name='TimeStamp', description='The timestamp of the returned data. The time follows the ISO 8601 standard. The time is displayed in UTC.', example='2019-12-02T11:25:00Z'),
    }
  ](name='QpsModel')
  }(name='Data', description='The returned data.'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='32DC9806-E9F9-4490-BBDC-B3A9E32FCC1D'),
}

model DescribeVodDomainRealTimeQpsDataResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeVodDomainRealTimeQpsDataResponseBody(name='body'),
}

/**
 * @summary Queries the number of queries per second (QPS) for one or more accelerated domains. The minimum time granularity is 1 minute. The minimum data latency is 5 minutes. You can query data in the last 186 days.
 *
 * @description * This operation is supported only in the **China (Shanghai)** region.
 * * You can specify a maximum of 500 accelerated domain names.
 * * If you specify neither `StartTime` nor `EndTime`, the data of the last 1 hour is queried. You can specify both `StartTime` and `EndTime` parameters to query data of a specified time range.
 * **Time granularity**
 * The time granularity varies with the time range specified by the `StartTime` and `EndTime` parameters. The following table describes the time period within which historical data is available and the data delay.
 * |Time granularity|Time range per query|Historical data available|Data delay|
 * |---|---|---|---|
 * |1 minute|Time range per query ≤ 1 hour|7 days|5 minutes|
 * |5 minutes|1 Hour &#x3C; Time range per query ≤ 3 days|93 days|15 minutes|
 * |1 hour|3 days &#x3C; Time range per query ≤ 31 days|186 days|3 to 4 hours|
 *
 * @param request DescribeVodDomainRealTimeQpsDataRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeVodDomainRealTimeQpsDataResponse
 */
async function describeVodDomainRealTimeQpsDataWithOptions(request: DescribeVodDomainRealTimeQpsDataRequest, runtime: $RuntimeOptions): DescribeVodDomainRealTimeQpsDataResponse {
  request.validate();
  var query = OpenApiUtil.query(request.toMap());
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'DescribeVodDomainRealTimeQpsData',
    version = '2017-03-21',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'GET',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Queries the number of queries per second (QPS) for one or more accelerated domains. The minimum time granularity is 1 minute. The minimum data latency is 5 minutes. You can query data in the last 186 days.
 *
 * @description * This operation is supported only in the **China (Shanghai)** region.
 * * You can specify a maximum of 500 accelerated domain names.
 * * If you specify neither `StartTime` nor `EndTime`, the data of the last 1 hour is queried. You can specify both `StartTime` and `EndTime` parameters to query data of a specified time range.
 * **Time granularity**
 * The time granularity varies with the time range specified by the `StartTime` and `EndTime` parameters. The following table describes the time period within which historical data is available and the data delay.
 * |Time granularity|Time range per query|Historical data available|Data delay|
 * |---|---|---|---|
 * |1 minute|Time range per query ≤ 1 hour|7 days|5 minutes|
 * |5 minutes|1 Hour &#x3C; Time range per query ≤ 3 days|93 days|15 minutes|
 * |1 hour|3 days &#x3C; Time range per query ≤ 31 days|186 days|3 to 4 hours|
 *
 * @param request DescribeVodDomainRealTimeQpsDataRequest
 * @return DescribeVodDomainRealTimeQpsDataResponse
 */
async function describeVodDomainRealTimeQpsData(request: DescribeVodDomainRealTimeQpsDataRequest): DescribeVodDomainRealTimeQpsDataResponse {
  var runtime = new $RuntimeOptions{};
  return describeVodDomainRealTimeQpsDataWithOptions(request, runtime);
}

model DescribeVodDomainRealTimeReqHitRateDataRequest {
  domainName?: string(name='DomainName', description='You can specify multiple domain names and separate them with commas (,). You can specify a maximum of 100 domain names in each call. If you specify multiple domain names, merged data is returned.

This parameter is required.', example='example.com'),
  endTime?: string(name='EndTime', description='The end of the time range to query.

Specify the time in the ISO 8601 standard in the yyyy-MM-ddTHH:mm:ssZ format. The time must be in UTC.

>  The end time must be later than the start time.', example='2024-01-02T11:26:00Z'),
  ownerId?: long(name='OwnerId'),
  startTime?: string(name='StartTime', description='The beginning of the time range to query.

Specify the time in the ISO 8601 standard in the yyyy-MM-ddTHH:mm:ssZ format. The time must be in UTC.', example='2024-01-02T11:23:00Z'),
}

model DescribeVodDomainRealTimeReqHitRateDataResponseBody = {
  data?: {
    reqHitRateDataModel?: [ 
    {
      reqHitRate?: float(name='ReqHitRate', description='The cache hit ratio that is calculated based on requests. The cache hit ratio is measured in percentage.', example='0.8956940476262277'),
      timeStamp?: string(name='TimeStamp', description='The timestamp of the data returned. The time follows the ISO 8601 standard. The time is displayed in UTC.', example='2024-01-02T11:26:00Z'),
    }
  ](name='ReqHitRateDataModel')
  }(name='Data', description='The returned results.'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='70A26B11-3673-479C-AEA8-E03FC5D3496D'),
}

model DescribeVodDomainRealTimeReqHitRateDataResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeVodDomainRealTimeReqHitRateDataResponseBody(name='body'),
}

/**
 * @summary Queries the request hit ratio data for one or more accelerated domain names. The minimum time granularity is 1 minute. The minimum data latency is 5 minutes. You can query data in the last 186 days.
 *
 * @description * This operation is supported only in the **China (Shanghai)** region.
 * * You can specify a maximum of 100 accelerated domain names.
 * * If you specify neither `StartTime` nor `EndTime`, the data of the last 1 hour is queried. You can specify both `StartTime` and `EndTime` parameters to query data of a specified time range.
 * * By default, the POST method is used for Go. To use the FET method, you must declare `request.Method="GET"`.
 * **Time granularity**
 * The time granularity varies with the time range specified by the `StartTime` and `EndTime` parameters. The following table describes the time period within which historical data is available and the data delay.
 * |Time granularity|Time range per query|Historical data available|Data delay|
 * |---|---|---|---|
 * |1 minute|Time range per query ≤ 1 hour|7 days|5 minutes|
 * |5 minutes|1 hour &#x3C; Time range per query &#x3C; 3 days|93 days|15 minutes|
 * |1 hour|3 days ≤ Time range per query &#x3C; 31 days|186 days|3 to 4 hours|
 *
 * @param request DescribeVodDomainRealTimeReqHitRateDataRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeVodDomainRealTimeReqHitRateDataResponse
 */
async function describeVodDomainRealTimeReqHitRateDataWithOptions(request: DescribeVodDomainRealTimeReqHitRateDataRequest, runtime: $RuntimeOptions): DescribeVodDomainRealTimeReqHitRateDataResponse {
  request.validate();
  var query = OpenApiUtil.query(request.toMap());
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'DescribeVodDomainRealTimeReqHitRateData',
    version = '2017-03-21',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'GET',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Queries the request hit ratio data for one or more accelerated domain names. The minimum time granularity is 1 minute. The minimum data latency is 5 minutes. You can query data in the last 186 days.
 *
 * @description * This operation is supported only in the **China (Shanghai)** region.
 * * You can specify a maximum of 100 accelerated domain names.
 * * If you specify neither `StartTime` nor `EndTime`, the data of the last 1 hour is queried. You can specify both `StartTime` and `EndTime` parameters to query data of a specified time range.
 * * By default, the POST method is used for Go. To use the FET method, you must declare `request.Method="GET"`.
 * **Time granularity**
 * The time granularity varies with the time range specified by the `StartTime` and `EndTime` parameters. The following table describes the time period within which historical data is available and the data delay.
 * |Time granularity|Time range per query|Historical data available|Data delay|
 * |---|---|---|---|
 * |1 minute|Time range per query ≤ 1 hour|7 days|5 minutes|
 * |5 minutes|1 hour &#x3C; Time range per query &#x3C; 3 days|93 days|15 minutes|
 * |1 hour|3 days ≤ Time range per query &#x3C; 31 days|186 days|3 to 4 hours|
 *
 * @param request DescribeVodDomainRealTimeReqHitRateDataRequest
 * @return DescribeVodDomainRealTimeReqHitRateDataResponse
 */
async function describeVodDomainRealTimeReqHitRateData(request: DescribeVodDomainRealTimeReqHitRateDataRequest): DescribeVodDomainRealTimeReqHitRateDataResponse {
  var runtime = new $RuntimeOptions{};
  return describeVodDomainRealTimeReqHitRateDataWithOptions(request, runtime);
}

model DescribeVodDomainRealTimeTrafficDataRequest {
  domainName?: string(name='DomainName', description='You can specify multiple domain names and separate them with commas (,). You can specify a maximum of 500 domain names in each call.

This parameter is required.', example='example.com'),
  endTime?: string(name='EndTime', description='The end of the time range to query.

Specify the time in the ISO 8601 standard in the yyyy-MM-ddTHH:mm:ssZ format. The time must be in UTC.

>  The end time must be later than the start time.', example='2019-12-10T20:01:00Z'),
  ispNameEn?: string(name='IspNameEn', description='The name of the ISP. If you do not set this parameter, all ISPs are queried.', example='telecom'),
  locationNameEn?: string(name='LocationNameEn', description='The name of the region. If you do not set this parameter, data in all regions is queried.', example='shanghai'),
  ownerId?: long(name='OwnerId'),
  startTime?: string(name='StartTime', description='The beginning of the time range to query.

Specify the time in the ISO 8601 standard in the yyyy-MM-ddTHH:mm:ssZ format. The time must be in UTC.', example='2019-12-10T20:00:00Z'),
}

model DescribeVodDomainRealTimeTrafficDataResponseBody = {
  dataInterval?: string(name='DataInterval', description='The time interval at which data is returned. Unit: seconds.

The returned value varies based on the time range per query. Valid values: 60 (1 minute), 300 (5 minutes), and 3600 (1 hour). For more information, see the **Time granularity** section in the **API documentation**.', example='60'),
  domainName?: string(name='DomainName', description='The accelerated domain name.', example='example.com'),
  endTime?: string(name='EndTime', description='The end of the time range.', example='2019-12-10T20:01:00Z'),
  realTimeTrafficDataPerInterval?: {
    dataModule?: [ 
    {
      timeStamp?: string(name='TimeStamp', description='The timestamp of the data returned. The time follows the ISO 8601 standard. The time is displayed in UTC.', example='2019-12-10T20:01:00Z'),
      value?: string(name='Value', description='The traffic data. Unit: bytes.', example='0'),
    }
  ](name='DataModule')
  }(name='RealTimeTrafficDataPerInterval', description='The details of traffic data in each time interval.'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='A666D44F-19D6-490E-97CF-1A64AB962C57'),
  startTime?: string(name='StartTime', description='The beginning of the time range.', example='2019-12-10T20:00:00Z'),
}

model DescribeVodDomainRealTimeTrafficDataResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeVodDomainRealTimeTrafficDataResponseBody(name='body'),
}

/**
 * @summary Queries the traffic data for one or more accelerated domains. The minimum time granularity is 1 minute. The minimum data latency is 5 minutes. You can query data in the last 186 days. Compared with the DescribeVodDomainTrafficData operation, this operation provides a smaller time granularity, lower data latency, and allows you to query historical data within a shorter time period.
 *
 * @description * This operation is supported only in the **China (Shanghai)** region.
 * * You can specify a maximum of 100 accelerated domain names.
 * * If you specify neither `StartTime` nor `EndTime`, the data of the last 1 hour is queried. You can specify both `StartTime` and `EndTime` parameters to query data of a specified time range.
 * **Time granularity**
 * The time granularity varies with the time range specified by the `StartTime` and `EndTime` parameters. The following table describes the time period within which historical data is available and the data delay.
 * |Time granularity|Time range per query|Historical data available|Data delay|
 * |---|---|---|---|
 * |1 minute|Time range per query ≤ 1 hour|7 days|5 minutes|
 * |5 minutes|1 Hour &#x3C; Time range per query ≤ 3 days|93 days|15 minutes|
 * |1 hour|3 days &#x3C; Time range per query ≤ 31 days|186 days|3 to 4 hours|
 *
 * @param request DescribeVodDomainRealTimeTrafficDataRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeVodDomainRealTimeTrafficDataResponse
 */
async function describeVodDomainRealTimeTrafficDataWithOptions(request: DescribeVodDomainRealTimeTrafficDataRequest, runtime: $RuntimeOptions): DescribeVodDomainRealTimeTrafficDataResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.domainName)) {
    query['DomainName'] = request.domainName;
  }
  if (!$isNull(request.endTime)) {
    query['EndTime'] = request.endTime;
  }
  if (!$isNull(request.ispNameEn)) {
    query['IspNameEn'] = request.ispNameEn;
  }
  if (!$isNull(request.locationNameEn)) {
    query['LocationNameEn'] = request.locationNameEn;
  }
  if (!$isNull(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!$isNull(request.startTime)) {
    query['StartTime'] = request.startTime;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'DescribeVodDomainRealTimeTrafficData',
    version = '2017-03-21',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Queries the traffic data for one or more accelerated domains. The minimum time granularity is 1 minute. The minimum data latency is 5 minutes. You can query data in the last 186 days. Compared with the DescribeVodDomainTrafficData operation, this operation provides a smaller time granularity, lower data latency, and allows you to query historical data within a shorter time period.
 *
 * @description * This operation is supported only in the **China (Shanghai)** region.
 * * You can specify a maximum of 100 accelerated domain names.
 * * If you specify neither `StartTime` nor `EndTime`, the data of the last 1 hour is queried. You can specify both `StartTime` and `EndTime` parameters to query data of a specified time range.
 * **Time granularity**
 * The time granularity varies with the time range specified by the `StartTime` and `EndTime` parameters. The following table describes the time period within which historical data is available and the data delay.
 * |Time granularity|Time range per query|Historical data available|Data delay|
 * |---|---|---|---|
 * |1 minute|Time range per query ≤ 1 hour|7 days|5 minutes|
 * |5 minutes|1 Hour &#x3C; Time range per query ≤ 3 days|93 days|15 minutes|
 * |1 hour|3 days &#x3C; Time range per query ≤ 31 days|186 days|3 to 4 hours|
 *
 * @param request DescribeVodDomainRealTimeTrafficDataRequest
 * @return DescribeVodDomainRealTimeTrafficDataResponse
 */
async function describeVodDomainRealTimeTrafficData(request: DescribeVodDomainRealTimeTrafficDataRequest): DescribeVodDomainRealTimeTrafficDataResponse {
  var runtime = new $RuntimeOptions{};
  return describeVodDomainRealTimeTrafficDataWithOptions(request, runtime);
}

model DescribeVodDomainReqHitRateDataRequest {
  domainName?: string(name='DomainName', description='The accelerated domain name.

*   If you leave this parameter empty, the merged data of all your accelerated domain names is returned.
*   You can specify a maximum of 500 accelerated domain names. Separate multiple domain names with commas (,).', example='example.com'),
  endTime?: string(name='EndTime', description='The end of the time range to query.

Specify the time in the ISO 8601 standard in the yyyy-MM-ddTHH:mm:ssZ format. The time must be in UTC.

>  The end time must be later than the start time.', example='2023-12-22T08:00:00Z'),
  interval?: string(name='Interval', description='The time granularity. Unit: seconds. Valid values: **300**, **3600**, and **86400**. If you leave this parameter empty or specify an invalid value, the default value is used. The supported time granularity varies based on the time range specified by `EndTime` and `StartTime`. The following content describes the supported time granularity.

*   Time range per query < 3 days: **300** (default), **3600**, and **86400**
*   3 days ≤ Time range per query < 31 days: **3600** (default) and **86400**
*   31 days ≤ Time range per query ≤ 90 days: **86400** (default)', example='300'),
  startTime?: string(name='StartTime', description='The beginning of the time range to query. Specify the time in the ISO 8601 standard in the yyyy-MM-ddTHH:mm:ssZ format. The time must be in UTC.', example='2023-12-21T08:00:00Z'),
}

model DescribeVodDomainReqHitRateDataResponseBody = {
  data?: {
    dataModule?: [ 
    {
      httpsValue?: string(name='HttpsValue', description='The HTTPS request hit rate.', example='50'),
      timeStamp?: string(name='TimeStamp', description='The timestamp of the data returned. The time follows the ISO 8601 standard in the yyyy-MM-ddThh:mm:ssZ format. The time is displayed in UTC.', example='2023-12-21T08:00:00Z'),
      value?: string(name='Value', description='The total request hit rate.', example='100'),
    }
  ](name='DataModule')
  }(name='Data', description='The request hit rate data at each time interval.'),
  dataInterval?: string(name='DataInterval', description='The time interval at which data is returned, which is the time granularity. Unit: seconds.', example='300'),
  domainName?: string(name='DomainName', description='The accelerated domain name.', example='example.com'),
  endTime?: string(name='EndTime', description='The end of the time range.', example='2023-12-22T08:00:00Z'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='D94E471F-1A27-442E-552D-D4D2000C****'),
  startTime?: string(name='StartTime', description='The beginning of the time range.', example='2023-12-21T08:00:00Z'),
}

model DescribeVodDomainReqHitRateDataResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeVodDomainReqHitRateDataResponseBody(name='body'),
}

/**
 * @summary Queries the byte hit ratio for one or more accelerated domains. Request hit ratios are measured in percentage.
 *
 * @description * This operation is supported only in the **China (Shanghai)** region.
 * * You can specify a maximum of 500 accelerated domain names.
 * * If you specify neither `StartTime` nor `EndTime`, the data of the last 24 hours is queried. You can specify both `StartTime` and `EndTime` parameters to query data of a specified time range.
 * **Time granularity**
 * The time granularity varies with the time range specified by the `StartTime` and `EndTime` parameters. The following table describes the time period within which historical data is available and the data delay when you do not set `Interval`.
 * |Time granularity|Time range per query|Historical data available|Data delay|
 * |---|---|---|---|
 * |5 minutes|Time range per query &#x3C; 3 days|93 days|15 minutes|
 * |1 hour|3 days ≤ Time range per query &#x3C; 31 days|186 days|3 to 4 hours|
 * |1 day|31 days ≤ Time range per query ≤ 90 days|366 days|4 hours in most cases, not more than 24 hours|
 *
 * @param request DescribeVodDomainReqHitRateDataRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeVodDomainReqHitRateDataResponse
 */
async function describeVodDomainReqHitRateDataWithOptions(request: DescribeVodDomainReqHitRateDataRequest, runtime: $RuntimeOptions): DescribeVodDomainReqHitRateDataResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.domainName)) {
    query['DomainName'] = request.domainName;
  }
  if (!$isNull(request.endTime)) {
    query['EndTime'] = request.endTime;
  }
  if (!$isNull(request.interval)) {
    query['Interval'] = request.interval;
  }
  if (!$isNull(request.startTime)) {
    query['StartTime'] = request.startTime;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'DescribeVodDomainReqHitRateData',
    version = '2017-03-21',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Queries the byte hit ratio for one or more accelerated domains. Request hit ratios are measured in percentage.
 *
 * @description * This operation is supported only in the **China (Shanghai)** region.
 * * You can specify a maximum of 500 accelerated domain names.
 * * If you specify neither `StartTime` nor `EndTime`, the data of the last 24 hours is queried. You can specify both `StartTime` and `EndTime` parameters to query data of a specified time range.
 * **Time granularity**
 * The time granularity varies with the time range specified by the `StartTime` and `EndTime` parameters. The following table describes the time period within which historical data is available and the data delay when you do not set `Interval`.
 * |Time granularity|Time range per query|Historical data available|Data delay|
 * |---|---|---|---|
 * |5 minutes|Time range per query &#x3C; 3 days|93 days|15 minutes|
 * |1 hour|3 days ≤ Time range per query &#x3C; 31 days|186 days|3 to 4 hours|
 * |1 day|31 days ≤ Time range per query ≤ 90 days|366 days|4 hours in most cases, not more than 24 hours|
 *
 * @param request DescribeVodDomainReqHitRateDataRequest
 * @return DescribeVodDomainReqHitRateDataResponse
 */
async function describeVodDomainReqHitRateData(request: DescribeVodDomainReqHitRateDataRequest): DescribeVodDomainReqHitRateDataResponse {
  var runtime = new $RuntimeOptions{};
  return describeVodDomainReqHitRateDataWithOptions(request, runtime);
}

model DescribeVodDomainSrcBpsDataRequest {
  domainName?: string(name='DomainName', description='The accelerated domain name.

*   If you leave this parameter empty, the merged data of all your accelerated domain names is returned.
*   You can specify a maximum of 500 accelerated domain names. Separate multiple domain names with commas (,).', example='example.com'),
  endTime?: string(name='EndTime', description='The end of the time range to query.

Specify the time in the ISO 8601 standard in the yyyy-MM-ddTHH:mm:ssZ format. The time must be in UTC.

>  The end time must be later than the start time.', example='2022-04-26T15:59:59Z'),
  interval?: string(name='Interval', description='The time granularity. Unit: seconds. Valid values: **300**, **3600**, and **86400**. If you leave this parameter empty or specify an invalid value, the default value is used. The supported time granularity varies based on the time range specified by `EndTime` and `StartTime`. The following content describes the supported time granularity.

*   Time range per query < 3 days: **300** (default), **3600**, and **86400**
*   3 days ≤ Time range per query < 31 days: **3600** (default) and **86400**
*   31 days ≤ Time range per query ≤ 366 days: **86400** (default)', example='300'),
  ownerId?: long(name='OwnerId'),
  startTime?: string(name='StartTime', description='The start of the time range to query. Specify the time in the ISO 8601 standard in the yyyy-MM-ddTHH:mm:ssZ format. The time must be in UTC.', example='2022-04-25T16:00:00Z'),
}

model DescribeVodDomainSrcBpsDataResponseBody = {
  dataInterval?: string(name='DataInterval', description='The time interval at which data is returned, which is the time granularity. Unit: seconds.', example='300'),
  domainName?: string(name='DomainName', description='The accelerated domain name whose ICP filing status you want to update.', example='sample.com'),
  endTime?: string(name='EndTime', description='The end of the time range.', example='2022-08-23T02:02:57Z'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='25818875-5F78-4A13-BEF6-****'),
  srcBpsDataPerInterval?: {
    dataModule?: [ 
    {
      httpsValue?: string(name='HttpsValue', description='The bandwidth consumed for fetching resources from the origin over HTTPS.', example='0'),
      timeStamp?: string(name='TimeStamp', description='The timestamp of the data returned. The time follows the ISO 8601 standard in the yyyy-MM-ddThh:mm:ssZ format. The time is displayed in UTC.', example='2022-08-23T02:02:57Z'),
      value?: string(name='Value', description='The total origin bandwidth data. Unit: bit/s.', example='0'),
    }
  ](name='DataModule')
  }(name='SrcBpsDataPerInterval', description='The origin bandwidth data at each time interval.'),
  startTime?: string(name='StartTime', description='The beginning of the time range.', example='2022-07-12T16:00:00Z'),
}

model DescribeVodDomainSrcBpsDataResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeVodDomainSrcBpsDataResponseBody(name='body'),
}

/**
 * @summary Queries the bandwidth data during back-to-origin routing for one or more accelerated domain names.
 *
 * @description * This operation is supported only in the **China (Shanghai)** region.
 * * You can specify a maximum of 500 accelerated domain names.
 * * If you specify neither `StartTime` nor `EndTime`, the data of the last 24 hours is queried. You can specify both `StartTime` and `EndTime` parameters to query data of a specified time range.
 * **Time granularity**
 * The time granularity varies with the time range specified by the `StartTime` and `EndTime` parameters. The following table describes the time period within which historical data is available and the data delay when you do not set `Interval`.
 * |Time granularity|Time range per query|Historical data available|Data delay|
 * |---|---|---|---|
 * |5 minutes|Time range per query &#x3C; 3 days|93 days|15 minutes|
 * |1 hour|3 days ≤ Time range per query &#x3C; 31 days|186 days|3 to 4 hours|
 * |1 day|31 days ≤ Time span of a single query ≤ 366 days|366 days|4 hours in most cases, not more than 24 hours|
 *
 * @param request DescribeVodDomainSrcBpsDataRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeVodDomainSrcBpsDataResponse
 */
async function describeVodDomainSrcBpsDataWithOptions(request: DescribeVodDomainSrcBpsDataRequest, runtime: $RuntimeOptions): DescribeVodDomainSrcBpsDataResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.domainName)) {
    query['DomainName'] = request.domainName;
  }
  if (!$isNull(request.endTime)) {
    query['EndTime'] = request.endTime;
  }
  if (!$isNull(request.interval)) {
    query['Interval'] = request.interval;
  }
  if (!$isNull(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!$isNull(request.startTime)) {
    query['StartTime'] = request.startTime;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'DescribeVodDomainSrcBpsData',
    version = '2017-03-21',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Queries the bandwidth data during back-to-origin routing for one or more accelerated domain names.
 *
 * @description * This operation is supported only in the **China (Shanghai)** region.
 * * You can specify a maximum of 500 accelerated domain names.
 * * If you specify neither `StartTime` nor `EndTime`, the data of the last 24 hours is queried. You can specify both `StartTime` and `EndTime` parameters to query data of a specified time range.
 * **Time granularity**
 * The time granularity varies with the time range specified by the `StartTime` and `EndTime` parameters. The following table describes the time period within which historical data is available and the data delay when you do not set `Interval`.
 * |Time granularity|Time range per query|Historical data available|Data delay|
 * |---|---|---|---|
 * |5 minutes|Time range per query &#x3C; 3 days|93 days|15 minutes|
 * |1 hour|3 days ≤ Time range per query &#x3C; 31 days|186 days|3 to 4 hours|
 * |1 day|31 days ≤ Time span of a single query ≤ 366 days|366 days|4 hours in most cases, not more than 24 hours|
 *
 * @param request DescribeVodDomainSrcBpsDataRequest
 * @return DescribeVodDomainSrcBpsDataResponse
 */
async function describeVodDomainSrcBpsData(request: DescribeVodDomainSrcBpsDataRequest): DescribeVodDomainSrcBpsDataResponse {
  var runtime = new $RuntimeOptions{};
  return describeVodDomainSrcBpsDataWithOptions(request, runtime);
}

model DescribeVodDomainSrcTrafficDataRequest {
  domainName?: string(name='DomainName', description='The accelerated domain name. You can specify a maximum of 500 domain names in a request. Separate multiple domain names with commas (,). If you specify multiple domain names in a request, aggregation results are returned.

If you leave this parameter empty, the origin traffic data for all accelerated domain names is queried by default.', example='example.com'),
  endTime?: string(name='EndTime', description='The end of the time range to query. The end time must be later than the start time. Specify the time in the yyyy-MM-ddTHH:mm:ssZ format. The time must be in UTC.', example='2022-09-24T15:59:59Z'),
  interval?: string(name='Interval', description='The time interval between the data entries to return. Unit: seconds. Valid values:

*   **300**: 5 minutes
*   **3600**: 1 hour
*   **86400**: 1 day

> The time granularity supported by the Interval parameter varies based on the time range per query specified by using `StartTime` and `EndTime`. For more information, see the **Time granularity** section of this topic.', example='300'),
  ownerId?: long(name='OwnerId'),
  startTime?: string(name='StartTime', description='The beginning of the time range to query. Specify the time in the yyyy-MM-ddTHH:mm:ssZ format. The time must be in UTC.

If you leave this parameter empty, the origin traffic data that is generated in the last 24 hours is queried by default.', example='2022-03-22T16:00:00Z'),
}

model DescribeVodDomainSrcTrafficDataResponseBody = {
  dataInterval?: string(name='DataInterval', description='The time interval between the entries returned. Unit: seconds.', example='300'),
  domainName?: string(name='DomainName', description='The accelerated domain name.', example='example.com'),
  endTime?: string(name='EndTime', description='The end of the time range during which data was queried. The time follows the ISO 8601 standard in the *yyyy-MM-dd*T*HH:mm:ss*Z format. The time is displayed in UTC.', example='2022-09-23T15:59:59Z'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='25818875-5F78-4AF6-D7393642CA58****'),
  srcTrafficDataPerInterval?: {
    dataModule?: [ 
    {
      httpsValue?: string(name='HttpsValue', description='The amount of traffic generated by origin HTTPS requests.', example='0'),
      timeStamp?: string(name='TimeStamp', description='The timestamp of the returned data. The time follows the ISO 8601 standard in the *yyyy-MM-dd*T*HH:mm:ss*Z format. The time is displayed in UTC.', example='2022-09-23T15:59:59Z'),
      value?: string(name='Value', description='The traffic value at each time interval.', example='0'),
    }
  ](name='DataModule')
  }(name='SrcTrafficDataPerInterval', description='Details about the origin traffic returned at each time interval. Unit: bytes.'),
  startTime?: string(name='StartTime', description='The start of the time range during which data was queried. The time follows the ISO 8601 standard in the *yyyy-MM-dd*T*HH:mm:ss*Z format. The time is displayed in UTC.', example='2022-08-29T16:00:00Z'),
  totalTraffic?: string(name='TotalTraffic', description='The total traffic. Unit: bytes.', example='5906662826'),
}

model DescribeVodDomainSrcTrafficDataResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeVodDomainSrcTrafficDataResponseBody(name='body'),
}

/**
 * @summary Queries origin traffic data for accelerated domain names in ApsaraVideo VOD. The traffic is measured in bytes.
 *
 * @description * This operation is available only in the **China (Shanghai)** region.
 * * ApsaraVideo VOD stores the origin traffic data for 90 days before the data is deleted.
 * * If you do not set the `StartTime` or `EndTime` parameter, the request returns the data collected in the last 24 hours. If you set both the `StartTime` and `EndTime` parameters, the request returns the data collected within the specified time range.
 * * You can specify a maximum of 500 domain names in a request. Separate multiple domain names with commas (,). If you specify multiple domain names in a request, aggregation results are returned.
 * ### Time granularity
 * The time granularity supported by the Interval parameter varies based on the time range per query specified by using `StartTime` and `EndTime`. The following table describes the time period within which historical data is available and the data delay.
 * |Time granularity|Time range per query (days)|Historical data available (days)|Data delay|
 * |---|---|---|---|
 * |5 minutes|(0, 3\\]|93|15 minutes|
 * |1 hour|(3, 31\\]|186|4 hours|
 * |1 day|(31, 366\\]|366|04:00 on the next day|
 *
 * @param request DescribeVodDomainSrcTrafficDataRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeVodDomainSrcTrafficDataResponse
 */
async function describeVodDomainSrcTrafficDataWithOptions(request: DescribeVodDomainSrcTrafficDataRequest, runtime: $RuntimeOptions): DescribeVodDomainSrcTrafficDataResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.domainName)) {
    query['DomainName'] = request.domainName;
  }
  if (!$isNull(request.endTime)) {
    query['EndTime'] = request.endTime;
  }
  if (!$isNull(request.interval)) {
    query['Interval'] = request.interval;
  }
  if (!$isNull(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!$isNull(request.startTime)) {
    query['StartTime'] = request.startTime;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'DescribeVodDomainSrcTrafficData',
    version = '2017-03-21',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Queries origin traffic data for accelerated domain names in ApsaraVideo VOD. The traffic is measured in bytes.
 *
 * @description * This operation is available only in the **China (Shanghai)** region.
 * * ApsaraVideo VOD stores the origin traffic data for 90 days before the data is deleted.
 * * If you do not set the `StartTime` or `EndTime` parameter, the request returns the data collected in the last 24 hours. If you set both the `StartTime` and `EndTime` parameters, the request returns the data collected within the specified time range.
 * * You can specify a maximum of 500 domain names in a request. Separate multiple domain names with commas (,). If you specify multiple domain names in a request, aggregation results are returned.
 * ### Time granularity
 * The time granularity supported by the Interval parameter varies based on the time range per query specified by using `StartTime` and `EndTime`. The following table describes the time period within which historical data is available and the data delay.
 * |Time granularity|Time range per query (days)|Historical data available (days)|Data delay|
 * |---|---|---|---|
 * |5 minutes|(0, 3\\]|93|15 minutes|
 * |1 hour|(3, 31\\]|186|4 hours|
 * |1 day|(31, 366\\]|366|04:00 on the next day|
 *
 * @param request DescribeVodDomainSrcTrafficDataRequest
 * @return DescribeVodDomainSrcTrafficDataResponse
 */
async function describeVodDomainSrcTrafficData(request: DescribeVodDomainSrcTrafficDataRequest): DescribeVodDomainSrcTrafficDataResponse {
  var runtime = new $RuntimeOptions{};
  return describeVodDomainSrcTrafficDataWithOptions(request, runtime);
}

model DescribeVodDomainTrafficDataRequest {
  domainName?: string(name='DomainName', description='The accelerated domain name.

*   If you leave this parameter empty, the merged data of all your accelerated domain names is returned.
*   You can specify multiple domain names and separate them with commas (,). You can specify a maximum of 500 domain names in each call.
*   To obtain the accelerated domain name, perform the following steps: Log on to the [ApsaraVideo VOD console](https://vod.console.aliyun.com). In the left-side navigation pane, choose **Configuration Management > CDN Configuration > Domain Names**. On the Domain Names page, view the accelerated domain names. Alternatively, you can call the [DescribeVodUserDomains](~~DescribeVodUserDomains~~) operation to query the accelerated domain names.', example='example.com'),
  endTime?: string(name='EndTime', description='The end of the time range to query.

Specify the time in the ISO 8601 standard in the yyyy-MM-ddTHH:mm:ssZ format. The time must be in UTC.

>  The end time must be later than the start time.', example='2019-01-20T14:59:58Z'),
  interval?: string(name='Interval', description='The time granularity of the query. Unit: seconds. Valid values: **300**, **3600**, and **86400**. If you leave this parameter empty or specify an invalid value, the default value is used. The supported time granularity varies based on the time range specified by `EndTime` and `StartTime`. The following content describes the supported time granularity.

*   Time range per query < 3 days: **300** (default), **3600**, and **86400**
*   3 days ≤ Time range per query < 31 days: **3600** (default) and **86400**
*   31 days ≤ Time range per query ≤ 366 days: **86400** (default)', example='300'),
  ispNameEn?: string(name='IspNameEn', description='The name of the Internet service provider (ISP). If you leave this parameter empty, all ISPs are queried.', example='Alibaba'),
  locationNameEn?: string(name='LocationNameEn', description='The name of the region. If you leave this parameter empty, all regions are queried. You can specify only the China (Shanghai) region.', example='cn-shanghai'),
  ownerId?: long(name='OwnerId'),
  startTime?: string(name='StartTime', description='The start of the time range to query. Specify the time in the ISO 8601 standard in the yyyy-MM-ddTHH:mm:ssZ format. The time must be in UTC.', example='2019-01-20T13:59:58Z'),
}

model DescribeVodDomainTrafficDataResponseBody = {
  dataInterval?: string(name='DataInterval', description='The time interval at which data is returned, which is the time granularity. Unit: seconds.', example='3600'),
  domainName?: string(name='DomainName', description='The accelerated domain name.', example='example.com'),
  endTime?: string(name='EndTime', description='The end of the time range.', example='2019-01-20T14:59:58Z'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='D94E471F-1A27-442E-552D-D4D2000C****'),
  startTime?: string(name='StartTime', description='The beginning of the time range.', example='2019-01-20T13:59:58Z'),
  totalTraffic?: string(name='TotalTraffic', description='The total amount of network traffic.', example='5906662826'),
  trafficDataPerInterval?: {
    dataModule?: [ 
    {
      domesticValue?: string(name='DomesticValue', description='The amount of network traffic in the Chinese mainland. Unit: bytes.', example='0'),
      httpsDomesticValue?: string(name='HttpsDomesticValue', description='The amount of HTTPS network traffic on points of presence (POPs) in the Chinese mainland. Unit: bytes.', example='0'),
      httpsOverseasValue?: string(name='HttpsOverseasValue', description='The amount of HTTPS network traffic on POPs outside the Chinese mainland. Unit: bytes.', example='0'),
      httpsValue?: string(name='HttpsValue', description='The total amount of HTTPS network traffic on POPs. Unit: bytes.', example='0'),
      overseasValue?: string(name='OverseasValue', description='The amount of network traffic outside the Chinese mainland. Unit: bytes.', example='0'),
      timeStamp?: string(name='TimeStamp', description='The timestamp of the data returned. The time follows the ISO 8601 standard in the yyyy-MM-ddThh:mm:ssZ format. The time is displayed in UTC.', example='2019-01-15T19:00:00Z'),
      value?: string(name='Value', description='The total traffic. Unit: bytes.', example='0'),
    }
  ](name='DataModule')
  }(name='TrafficDataPerInterval', description='The amount of network traffic at each time interval.'),
}

model DescribeVodDomainTrafficDataResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeVodDomainTrafficDataResponseBody(name='body'),
}

/**
 * @summary Queries the traffic data for one or more accelerated domains. The minimum time granularity is 5 minutes. You can query data in the last 366 days. Compared with the DescribeVodDomainRealTimeTrafficData operation, this operation provides a greater time granularity, higher data latency, but allows you to query historical data within a longer time period.
 *
 * @description * This operation is supported only in the **China (Shanghai)** region.
 * * You can specify a maximum of 500 accelerated domain names.
 * * If you specify neither `StartTime` nor `EndTime`, the data of the last 24 hour is queried. You can specify both `StartTime` and `EndTime` parameters to query data of a specified time range.
 * **Time granularity**
 * The time granularity varies with the time range specified by the `StartTime` and `EndTime` parameters. The following table describes the time period within which historical data is available and the data delay when you do not set `Interval`.
 * |Time granularity|Time range per query|Historical data available|Data delay|
 * |---|---|---|---|
 * |5 minutes|Time range per query &#x3C; 3 days|93 days|15 minutes|
 * |1 hour|3 days ≤ Time range per query &#x3C; 31 days|186 days|3 to 4 hours|
 * |1 day|31 days ≤ Time range per query ≤ 366 days|366 days|4 hours in most cases, not more than 24 hours|
 *
 * @param request DescribeVodDomainTrafficDataRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeVodDomainTrafficDataResponse
 */
async function describeVodDomainTrafficDataWithOptions(request: DescribeVodDomainTrafficDataRequest, runtime: $RuntimeOptions): DescribeVodDomainTrafficDataResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.domainName)) {
    query['DomainName'] = request.domainName;
  }
  if (!$isNull(request.endTime)) {
    query['EndTime'] = request.endTime;
  }
  if (!$isNull(request.interval)) {
    query['Interval'] = request.interval;
  }
  if (!$isNull(request.ispNameEn)) {
    query['IspNameEn'] = request.ispNameEn;
  }
  if (!$isNull(request.locationNameEn)) {
    query['LocationNameEn'] = request.locationNameEn;
  }
  if (!$isNull(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!$isNull(request.startTime)) {
    query['StartTime'] = request.startTime;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'DescribeVodDomainTrafficData',
    version = '2017-03-21',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Queries the traffic data for one or more accelerated domains. The minimum time granularity is 5 minutes. You can query data in the last 366 days. Compared with the DescribeVodDomainRealTimeTrafficData operation, this operation provides a greater time granularity, higher data latency, but allows you to query historical data within a longer time period.
 *
 * @description * This operation is supported only in the **China (Shanghai)** region.
 * * You can specify a maximum of 500 accelerated domain names.
 * * If you specify neither `StartTime` nor `EndTime`, the data of the last 24 hour is queried. You can specify both `StartTime` and `EndTime` parameters to query data of a specified time range.
 * **Time granularity**
 * The time granularity varies with the time range specified by the `StartTime` and `EndTime` parameters. The following table describes the time period within which historical data is available and the data delay when you do not set `Interval`.
 * |Time granularity|Time range per query|Historical data available|Data delay|
 * |---|---|---|---|
 * |5 minutes|Time range per query &#x3C; 3 days|93 days|15 minutes|
 * |1 hour|3 days ≤ Time range per query &#x3C; 31 days|186 days|3 to 4 hours|
 * |1 day|31 days ≤ Time range per query ≤ 366 days|366 days|4 hours in most cases, not more than 24 hours|
 *
 * @param request DescribeVodDomainTrafficDataRequest
 * @return DescribeVodDomainTrafficDataResponse
 */
async function describeVodDomainTrafficData(request: DescribeVodDomainTrafficDataRequest): DescribeVodDomainTrafficDataResponse {
  var runtime = new $RuntimeOptions{};
  return describeVodDomainTrafficDataWithOptions(request, runtime);
}

model DescribeVodDomainUsageDataRequest {
  area?: string(name='Area', description='The region in which you want to query data. Valid values:

*   **CN**: Chinese mainland
*   **OverSeas**: outside the Chinese mainland', example='CN'),
  domainName?: string(name='DomainName', description='The accelerated domain name. If you leave this parameter empty, the merged data of all your accelerated domain names is returned. Separate multiple accelerated domain names with commas (,).', example='example.com'),
  endTime?: string(name='EndTime', description='The end of the time range to query. The end time must be later than the start time. Specify the time in the ISO 8601 standard in the *yyyy-MM-dd*T*HH:mm:ss*Z format. The time must be in UTC.

This parameter is required.', example='2015-12-10T12:20:00Z'),
  field?: string(name='Field', description='The type of the data to return. Valid values:

*   **bps**: bandwidth
*   **traf**: traffic

This parameter is required.', example='bps'),
  interval?: string(name='Interval', description='The time interval between the data entries to return. Unit: seconds. Valid values: **300** (5 minutes), **3600** (1 hour), and **86400** (1 day).

*   If **Interval** is set to **300**, you can query usage data in the last six months. The maximum time range per query that can be specified is three days.
*   If **Interval** is set to **3600** or **86400**, you can query usage data of the previous year.
*   If you do not set the **Interval** parameter, the maximum time range that you can query is one month. If you specify a time range of 1 to 3 days, the time interval between the entries that are returned is 1 hour. If you specify a time range of at least 4 days, the time interval between the entries that are returned is 1 day.', example='300'),
  ownerId?: long(name='OwnerId'),
  startTime?: string(name='StartTime', description='The beginning of the time range to query. Specify the time in the ISO 8601 standard in the *yyyy-MM-dd*T*HH:mm:ss*Z format. The time must be in UTC.

This parameter is required.', example='2015-12-10T10:20:00Z'),
  type?: string(name='Type', description='The type of content that you want to query. Valid values:

*   **static**: static content
*   **dynamic**: dynamic requests
*   **all**: all content', example='static'),
}

model DescribeVodDomainUsageDataResponseBody = {
  area?: string(name='Area', description='The billable region where the data was collected.', example='CN'),
  dataInterval?: string(name='DataInterval', description='The time interval between the entries returned. Unit: seconds.', example='300'),
  domainName?: string(name='DomainName', description='The accelerated domain name.', example='example.com'),
  endTime?: string(name='EndTime', description='The end of the time range during which data was queried. The time follows the ISO 8601 standard in the *yyyy-MM-dd*T*HH:mm:ss*Z format. The time is displayed in UTC.', example='2015-12-10T12:20:00Z'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='B955107D-E658-4E77-****-E0AC3D31693E'),
  startTime?: string(name='StartTime', description='The start of the time range during which data was queried. The time follows the ISO 8601 standard in the *yyyy-MM-dd*T*HH:mm:ss*Z format. The time is displayed in UTC.', example='2015-12-10T10:20:00Z'),
  type?: string(name='Type', description='The type of the data. Valid values:

*   **bps**: bandwidth
*   **traf**: traffic', example='static'),
  usageDataPerInterval?: {
    dataModule?: [ 
    {
      timeStamp?: string(name='TimeStamp', description='The timestamp of the returned data. The time is in the *yyyy-MM-dd*T*HH:mm:ss*Z format. The time is displayed in UTC.', example='2015-12-10T10:00:00Z'),
      value?: string(name='Value', description='The traffic or bandwidth data. Unit: bit/s.', example='2592.3920000000003'),
    }
  ](name='DataModule')
  }(name='UsageDataPerInterval', description='The traffic or bandwidth data returned at each interval.'),
}

model DescribeVodDomainUsageDataResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeVodDomainUsageDataResponseBody(name='body'),
}

/**
 * @summary Queries the traffic or bandwidth data of one or more accelerated domain names.
 *
 * @description *   This operation is available only in the **China (Shanghai)** region.
 * *   You can specify up to 100 accelerated domain names in a request. Separate multiple domain names with commas (,). If you do not specify an accelerated domain name, the data of all accelerated domain names within your Alibaba Cloud account is returned.
 * *   You can query data in the last year. The maximum time range that can be queried is three months. If you specify a time range of one to three days, the system returns data on an hourly basis. If you specify a time range of four days or more, the system returns data on a daily basis.
 *
 * @param request DescribeVodDomainUsageDataRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeVodDomainUsageDataResponse
 */
async function describeVodDomainUsageDataWithOptions(request: DescribeVodDomainUsageDataRequest, runtime: $RuntimeOptions): DescribeVodDomainUsageDataResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.area)) {
    query['Area'] = request.area;
  }
  if (!$isNull(request.domainName)) {
    query['DomainName'] = request.domainName;
  }
  if (!$isNull(request.endTime)) {
    query['EndTime'] = request.endTime;
  }
  if (!$isNull(request.field)) {
    query['Field'] = request.field;
  }
  if (!$isNull(request.interval)) {
    query['Interval'] = request.interval;
  }
  if (!$isNull(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!$isNull(request.startTime)) {
    query['StartTime'] = request.startTime;
  }
  if (!$isNull(request.type)) {
    query['Type'] = request.type;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'DescribeVodDomainUsageData',
    version = '2017-03-21',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Queries the traffic or bandwidth data of one or more accelerated domain names.
 *
 * @description *   This operation is available only in the **China (Shanghai)** region.
 * *   You can specify up to 100 accelerated domain names in a request. Separate multiple domain names with commas (,). If you do not specify an accelerated domain name, the data of all accelerated domain names within your Alibaba Cloud account is returned.
 * *   You can query data in the last year. The maximum time range that can be queried is three months. If you specify a time range of one to three days, the system returns data on an hourly basis. If you specify a time range of four days or more, the system returns data on a daily basis.
 *
 * @param request DescribeVodDomainUsageDataRequest
 * @return DescribeVodDomainUsageDataResponse
 */
async function describeVodDomainUsageData(request: DescribeVodDomainUsageDataRequest): DescribeVodDomainUsageDataResponse {
  var runtime = new $RuntimeOptions{};
  return describeVodDomainUsageDataWithOptions(request, runtime);
}

model DescribeVodEditingUsageDataRequest {
  appId?: string(name='AppId', example='app-****'),
  endTime?: string(name='EndTime', example='2024-11-07T16:00:00Z'),
  ownerId?: long(name='OwnerId'),
  region?: string(name='Region', example='cn-beijing'),
  specification?: string(name='Specification', example='H264.SD'),
  startTime?: string(name='StartTime', example='2024-11-06T16:00:00Z'),
}

model DescribeVodEditingUsageDataResponseBody = {
  editingData?: [ 
    {
      duration?: long(name='Duration', example='123'),
      region?: string(name='Region', example='cn-beijing'),
      specification?: string(name='Specification', example='H264.SD'),
      timeStamp?: string(name='TimeStamp', example='2024-11-06T16:00:00Z'),
    }
  ](name='EditingData'),
  endTime?: string(name='EndTime', example='2024-11-07T16:00:00Z'),
  requestId?: string(name='RequestId', example='6CB55B62-6E5F-54D1-80BF-DFA3DE9F0***'),
  startTime?: string(name='StartTime', example='2024-11-06T16:00:00Z'),
}

model DescribeVodEditingUsageDataResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeVodEditingUsageDataResponseBody(name='body'),
}

/**
 * @summary 点播云剪辑用量查询
 *
 * @param request DescribeVodEditingUsageDataRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeVodEditingUsageDataResponse
 */
async function describeVodEditingUsageDataWithOptions(request: DescribeVodEditingUsageDataRequest, runtime: $RuntimeOptions): DescribeVodEditingUsageDataResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.appId)) {
    query['AppId'] = request.appId;
  }
  if (!$isNull(request.endTime)) {
    query['EndTime'] = request.endTime;
  }
  if (!$isNull(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!$isNull(request.region)) {
    query['Region'] = request.region;
  }
  if (!$isNull(request.specification)) {
    query['Specification'] = request.specification;
  }
  if (!$isNull(request.startTime)) {
    query['StartTime'] = request.startTime;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'DescribeVodEditingUsageData',
    version = '2017-03-21',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 点播云剪辑用量查询
 *
 * @param request DescribeVodEditingUsageDataRequest
 * @return DescribeVodEditingUsageDataResponse
 */
async function describeVodEditingUsageData(request: DescribeVodEditingUsageDataRequest): DescribeVodEditingUsageDataResponse {
  var runtime = new $RuntimeOptions{};
  return describeVodEditingUsageDataWithOptions(request, runtime);
}

model DescribeVodMediaPlayDataRequest {
  mediaId?: string(name='MediaId', description='The ID of the media file (VideoId). You can specify this parameter to query all playback data of a media file. You can specify only one media ID. You can use one of the following methods to obtain the ID:

*   Log on to the [ApsaraVideo VOD console](https://vod.console.aliyun.com). In the left-side navigation pane, choose **Media Files** > **Audio/Video**. On the page that appears, view the media ID.
*   Obtain the value of the VideoId parameter in the response to the [CreateUploadVideo](~~CreateUploadVideo~~) operation that you called to upload the audio or video file.
*   Obtain the value of VideoId by calling the [SearchMedia](~~SearchMedia~~) operation. This method is applicable to files that have been uploaded.', example='9ae2af636ca6c10412f44891fc****'),
  orderName?: string(name='OrderName', description='The name of the metric. This parameter must be specified together with the `OrderType` parameter. You can specify this parameter to sort the returned data in ascending or descending order based on specific metrics. Valid values:

*   **PlaySuccessVv**: the total number of views.
*   **PlayPerVv**: the average views per viewer.
*   **PlayDuration**: the total playback duration.
*   **PlayDurationPerUv**: the average playback duration per viewer.', example='PlaySuccessVv'),
  orderType?: string(name='OrderType', description='The sort type. This parameter must be specified together with the `OrderName` parameter. You can specify this parameter to sort the returned data in ascending or descending order based on specific metrics. Valid values:

*   **ASC**: The returned data is sorted in ascending order.
*   **DESC**: The returned data is sorted in descending order.', example='ASC'),
  os?: string(name='Os', description='The operating system of the player. You can specify this parameter to query all playback data generated on a specific operating system. Valid values:

*   **Android**
*   **iOS**
*   **Windows**
*   **macOS**
*   **Linux**', example='Android'),
  pageNo?: long(name='PageNo', description='The number of the page. You can specify a page number to return data from the specified page.

This parameter is required.', example='1'),
  pageSize?: long(name='PageSize', description='The number of entries per page. Maximum value: 100.

This parameter is required.', example='20'),
  playDate?: string(name='PlayDate', description='The playback time. Specify the value in the yyyyMMdd format.

> *   You can query data only by day.
> *   You can query only data within the last 30 days.', example='20240322'),
  region?: string(name='Region', description='The region in which ApsaraVideo VOD is activated. You can specify this parameter to query all playback data generated only in a specific region. Valid values:

*   **cn-beijing**: China (Beijing)
*   **cn-shanghai**: China (Shanghai)
*   **cn-shenzhen**: China (Shenzhen)
*   **ap-northeast-1**: Japan (Tokyo)
*   **ap-southeast-1**: Singapore
*   **ap-southeast-5**: Indonesia (Jakarta)
*   **eu-central-1**: Germany (Frankfurt)', example='cn-beijing'),
  terminalType?: string(name='TerminalType', description='The type of the player SDK. You can specify this parameter to query all playback data generated by using a specific type of player SDK. Valid values:

*   **Native**: ApsaraVideo Player SDK for Android or ApsaraVideo Player SDK for iOS
*   **Web**: ApsaraVideo Player SDK for Web', example='Native'),
}

model DescribeVodMediaPlayDataResponseBody = {
  pageNo?: long(name='PageNo', description='The page number.', example='1'),
  pageSize?: long(name='PageSize', description='The number of entries per page.', example='20'),
  qoeInfoList?: [ 
    {
      DAU?: float(name='DAU', description='The number of visits to the audio or video per day.', example='5'),
      mediaId?: string(name='MediaId', description='The ID of the media file (VideoId).', example='9ae2af636ca6c10412f44891fc****'),
      playDuration?: float(name='PlayDuration', description='The total playback duration of the audio or video. Unit: seconds.', example='2400'),
      playDurationPerUv?: float(name='PlayDurationPerUv', description='The average playback duration of the audio or video per viewer. Unit: seconds.', example='120'),
      playPerVv?: float(name='PlayPerVv', description='The average number of times that the audio or video was played per viewer.', example='4'),
      playSuccessVv?: float(name='PlaySuccessVv', description='The total number of times the audio or video has been played.', example='20'),
      videoDuration?: float(name='VideoDuration', description='The duration of the audio or video file. Unit: seconds.', example='246'),
      videoTitle?: string(name='VideoTitle', description='The name of the audio or video file.', example='title'),
    }
  ](name='QoeInfoList', description='The data returned.'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='25818875-5F78-4AF6-D7393642CA58****'),
  totalCount?: long(name='TotalCount', description='The total number of entries returned.', example='1'),
}

model DescribeVodMediaPlayDataResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeVodMediaPlayDataResponseBody(name='body'),
}

/**
 * @summary Queries the playback statistics based on the media ID. You can call this operation to query information such as the number of visits, average video views per viewer, total number of views, average playback duration per viewer, and total playback duration.
 *
 * @description *   This operation is available only in the **China (Shanghai)** region.
 * *   Only playback data in ApsaraVideo Player SDK is collected.
 * *   You can query only data within the last 30 days.
 * *   Before you call this operation, make sure that the following requirements are met:
 *     *   ApsaraVideo Player SDK for Android or iOS
 *         *   ApsaraVideo Player SDK for Android or iOS V5.4.9.2 or later is used.
 *         *   A license for ApsaraVideo Player SDK is obtained. For more information, see [Manage licenses](https://help.aliyun.com/document_detail/469166.html).
 *         *   The log reporting feature is enabled. By default, the feature is enabled for ApsaraVideo Player SDKs. For more information, see [Integrate ApsaraVideo Player SDK for Android](~~311525#section-dc4-gp6-xk2~~) and [Integrate ApsaraVideo Player SDK for iOS](~~313855#section-cmf-k7d-jg5~~).
 *     *   ApsaraVideo Player SDK for Web
 *         *   ApsaraVideo Player SDK for Web V2.16.0 or later is used.
 *         *   A license for **playback quality monitoring** is obtained. To apply for the license, [submit a request on Yida to enable value-added features for ApsaraVideo Player SDK for Web](https://yida.alibaba-inc.com/o/webplayer#/). For more information, see the description of the `license` parameter in the [API operations](~~125572#section-3ty-gwp-6pa~~) topic.
 *         *   The log reporting feature is enabled. By default, the feature is enabled for ApsaraVideo Player SDKs.
 *
 * @param request DescribeVodMediaPlayDataRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeVodMediaPlayDataResponse
 */
async function describeVodMediaPlayDataWithOptions(request: DescribeVodMediaPlayDataRequest, runtime: $RuntimeOptions): DescribeVodMediaPlayDataResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.mediaId)) {
    query['MediaId'] = request.mediaId;
  }
  if (!$isNull(request.orderName)) {
    query['OrderName'] = request.orderName;
  }
  if (!$isNull(request.orderType)) {
    query['OrderType'] = request.orderType;
  }
  if (!$isNull(request.os)) {
    query['Os'] = request.os;
  }
  if (!$isNull(request.pageNo)) {
    query['PageNo'] = request.pageNo;
  }
  if (!$isNull(request.pageSize)) {
    query['PageSize'] = request.pageSize;
  }
  if (!$isNull(request.playDate)) {
    query['PlayDate'] = request.playDate;
  }
  if (!$isNull(request.region)) {
    query['Region'] = request.region;
  }
  if (!$isNull(request.terminalType)) {
    query['TerminalType'] = request.terminalType;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'DescribeVodMediaPlayData',
    version = '2017-03-21',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Queries the playback statistics based on the media ID. You can call this operation to query information such as the number of visits, average video views per viewer, total number of views, average playback duration per viewer, and total playback duration.
 *
 * @description *   This operation is available only in the **China (Shanghai)** region.
 * *   Only playback data in ApsaraVideo Player SDK is collected.
 * *   You can query only data within the last 30 days.
 * *   Before you call this operation, make sure that the following requirements are met:
 *     *   ApsaraVideo Player SDK for Android or iOS
 *         *   ApsaraVideo Player SDK for Android or iOS V5.4.9.2 or later is used.
 *         *   A license for ApsaraVideo Player SDK is obtained. For more information, see [Manage licenses](https://help.aliyun.com/document_detail/469166.html).
 *         *   The log reporting feature is enabled. By default, the feature is enabled for ApsaraVideo Player SDKs. For more information, see [Integrate ApsaraVideo Player SDK for Android](~~311525#section-dc4-gp6-xk2~~) and [Integrate ApsaraVideo Player SDK for iOS](~~313855#section-cmf-k7d-jg5~~).
 *     *   ApsaraVideo Player SDK for Web
 *         *   ApsaraVideo Player SDK for Web V2.16.0 or later is used.
 *         *   A license for **playback quality monitoring** is obtained. To apply for the license, [submit a request on Yida to enable value-added features for ApsaraVideo Player SDK for Web](https://yida.alibaba-inc.com/o/webplayer#/). For more information, see the description of the `license` parameter in the [API operations](~~125572#section-3ty-gwp-6pa~~) topic.
 *         *   The log reporting feature is enabled. By default, the feature is enabled for ApsaraVideo Player SDKs.
 *
 * @param request DescribeVodMediaPlayDataRequest
 * @return DescribeVodMediaPlayDataResponse
 */
async function describeVodMediaPlayData(request: DescribeVodMediaPlayDataRequest): DescribeVodMediaPlayDataResponse {
  var runtime = new $RuntimeOptions{};
  return describeVodMediaPlayDataWithOptions(request, runtime);
}

model DescribeVodRangeDataByLocateAndIspServiceRequest {
  domainName?: string(name='DomainName', description='The accelerated domain name.

This parameter is required.', example='example.com'),
  endTime?: string(name='EndTime', description='The end of the time range to query. Specify the time in the ISO 8601 standard in the *yyyy-MM-dd*T*HH:mm:ss*Z format. The time must be in UTC.

This parameter is required.', example='2023-05-29T03:55:00Z'),
  ispNameEn?: string(name='IspNameEn', description='The name of the ISP. If you leave this parameter empty, all ISPs are queried.', example='unicom'),
  locationNameEn?: string(name='LocationNameEn', description='The name of the region. If you leave this parameter empty, data in all regions is queried.', example='beijing'),
  ownerId?: long(name='OwnerId'),
  startTime?: string(name='StartTime', description='The beginning of the time range to query. Specify the time in the ISO 8601 standard in the *yyyy-MM-dd*T*HH:mm:ss*Z format. The time must be in UTC.

This parameter is required.', example='2023-05-29T03:50:00Z'),
}

model DescribeVodRangeDataByLocateAndIspServiceResponseBody = {
  jsonResult?: string(name='JsonResult', description='The returned result. The value is in the JSON format. These parameters indicate the following information in sequence: UNIX time, region, ISP, distribution of HTTP status codes, response time, bandwidth (bit/s), average response rate, page views, cache hit ratio, and request hit ratio.', example='{"1472659200":{"tianjin":{"unicom":{"http_codes":{"000":0,"200":6,"400":0},"rt":4183,"bandwidth":46639,"avg_speed":7773,"pv":6,"hit_rate":0.93,"request_hit_rate":0.66}}}}'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='C74802AA-C277-5A80-BDF2-072B05F119C7'),
}

model DescribeVodRangeDataByLocateAndIspServiceResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeVodRangeDataByLocateAndIspServiceResponseBody(name='body'),
}

/**
 * @summary Queries the bandwidth data by Internet service provider (ISP) and region.
 *
 * @description The data is collected every 5 minutes. You can call this API operation up to 20 times per second per account. Time granularity
 * The time granularity supported by Interval, the maximum time period within which historical data is available, and the data delay vary based on the time range to query, as described in the following table.
 * |Time granularity|Maximum time range per query|Historical data available|Data delay|
 * |---|---|---|---|
 * |5 minutes|1 hour|93 days|15 minutes|
 *
 * @param request DescribeVodRangeDataByLocateAndIspServiceRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeVodRangeDataByLocateAndIspServiceResponse
 */
async function describeVodRangeDataByLocateAndIspServiceWithOptions(request: DescribeVodRangeDataByLocateAndIspServiceRequest, runtime: $RuntimeOptions): DescribeVodRangeDataByLocateAndIspServiceResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.domainName)) {
    query['DomainName'] = request.domainName;
  }
  if (!$isNull(request.endTime)) {
    query['EndTime'] = request.endTime;
  }
  if (!$isNull(request.ispNameEn)) {
    query['IspNameEn'] = request.ispNameEn;
  }
  if (!$isNull(request.locationNameEn)) {
    query['LocationNameEn'] = request.locationNameEn;
  }
  if (!$isNull(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!$isNull(request.startTime)) {
    query['StartTime'] = request.startTime;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'DescribeVodRangeDataByLocateAndIspService',
    version = '2017-03-21',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Queries the bandwidth data by Internet service provider (ISP) and region.
 *
 * @description The data is collected every 5 minutes. You can call this API operation up to 20 times per second per account. Time granularity
 * The time granularity supported by Interval, the maximum time period within which historical data is available, and the data delay vary based on the time range to query, as described in the following table.
 * |Time granularity|Maximum time range per query|Historical data available|Data delay|
 * |---|---|---|---|
 * |5 minutes|1 hour|93 days|15 minutes|
 *
 * @param request DescribeVodRangeDataByLocateAndIspServiceRequest
 * @return DescribeVodRangeDataByLocateAndIspServiceResponse
 */
async function describeVodRangeDataByLocateAndIspService(request: DescribeVodRangeDataByLocateAndIspServiceRequest): DescribeVodRangeDataByLocateAndIspServiceResponse {
  var runtime = new $RuntimeOptions{};
  return describeVodRangeDataByLocateAndIspServiceWithOptions(request, runtime);
}

model DescribeVodRefreshQuotaRequest {
  ownerId?: long(name='OwnerId'),
  securityToken?: string(name='SecurityToken'),
}

model DescribeVodRefreshQuotaResponseBody = {
  blockQuota?: string(name='BlockQuota', description='The maximum number of Object Storage Service (OSS) buckets that can be refreshed each day.', example='500'),
  dirQuota?: string(name='DirQuota', description='The maximum number of directories of files that can be refreshed each day.', example='100'),
  dirRemain?: string(name='DirRemain', description='The remaining number of directories of files that can be refreshed on the current day.', example='99'),
  preloadQuota?: string(name='PreloadQuota', description='The maximum number of URLs of files that can be prefetched each day.', example='500'),
  preloadRemain?: string(name='PreloadRemain', description='The remaining number of URLs of files that can be prefetched on the current day.', example='500'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='42E0554B-80F4-4921-****-ACFB22CAAAD0'),
  urlQuota?: string(name='UrlQuota', description='The maximum number of URLs of files that can be refreshed each day.', example='2000'),
  urlRemain?: string(name='UrlRemain', description='The remaining number of URLs of files that can be refreshed on the current day.', example='1996'),
  blockRemain?: string(name='blockRemain', description='The remaining number of OSS buckets that can be refreshed on the current day.', example='500'),
}

model DescribeVodRefreshQuotaResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeVodRefreshQuotaResponseBody(name='body'),
}

/**
 * @summary Queries the maximum number and remaining number of requests to refresh or prefetch files on the current day. You can prefetch files based on URLs and refresh files based on URLs or directories.
 *
 * @description > *   This operation is available only in the **China (Shanghai)** region.
 * > *   You can call the [RefreshVodObjectCaches](https://help.aliyun.com/document_detail/69215.html) operation to refresh content and the [PreloadVodObjectCaches](https://help.aliyun.com/document_detail/69211.html) operation to prefetch content.
 *
 * @param request DescribeVodRefreshQuotaRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeVodRefreshQuotaResponse
 */
async function describeVodRefreshQuotaWithOptions(request: DescribeVodRefreshQuotaRequest, runtime: $RuntimeOptions): DescribeVodRefreshQuotaResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!$isNull(request.securityToken)) {
    query['SecurityToken'] = request.securityToken;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'DescribeVodRefreshQuota',
    version = '2017-03-21',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Queries the maximum number and remaining number of requests to refresh or prefetch files on the current day. You can prefetch files based on URLs and refresh files based on URLs or directories.
 *
 * @description > *   This operation is available only in the **China (Shanghai)** region.
 * > *   You can call the [RefreshVodObjectCaches](https://help.aliyun.com/document_detail/69215.html) operation to refresh content and the [PreloadVodObjectCaches](https://help.aliyun.com/document_detail/69211.html) operation to prefetch content.
 *
 * @param request DescribeVodRefreshQuotaRequest
 * @return DescribeVodRefreshQuotaResponse
 */
async function describeVodRefreshQuota(request: DescribeVodRefreshQuotaRequest): DescribeVodRefreshQuotaResponse {
  var runtime = new $RuntimeOptions{};
  return describeVodRefreshQuotaWithOptions(request, runtime);
}

model DescribeVodRefreshTasksRequest {
  domainName?: string(name='DomainName', description='The domain name.', example='example.com'),
  endTime?: string(name='EndTime', description='The end of the time range to query. Specify the time in the ISO 8601 standard in the *yyyy-MM-dd*T*HH:mm:ss*Z format. The time must be in UTC.', example='2017-01-01T12:30:20Z'),
  objectPath?: string(name='ObjectPath', description='The path of the object. The path is used as a condition for exact matching.', example='http://example.com/***.txt'),
  objectType?: string(name='ObjectType', description='The type of the task. Valid values:

*   **file**: refreshes one or more files.
*   **directory**: refreshes files in the specified directories.
*   **preload**: prefetches one or more files.

> If you specify the DomainName or Status parameter, you must also specify the ObjectType parameter.', example='file'),
  ownerId?: long(name='OwnerId'),
  pageNumber?: int32(name='PageNumber', description='The page number.', example='1'),
  pageSize?: int32(name='PageSize', description='The number of entries to return on each page. Default value: **20**. Maximum value: **50**.', example='20'),
  securityToken?: string(name='SecurityToken'),
  startTime?: string(name='StartTime', description='The beginning of the time range to query. Specify the time in the ISO 8601 standard in the *yyyy-MM-dd*T*HH:mm:ss*Z format. The time must be in UTC.

> You can query data that is collected in the last three days.', example='2017-01-01T12:12:20Z'),
  status?: string(name='Status', description='The status of the task. Valid values:

*   **Complete**: The task is complete.
*   **Refreshing**: The task is in progress.
*   **Failed**: The task failed.', example='Complete'),
  taskId?: string(name='TaskId', description='The ID of the task that you want to query.', example='70422****'),
}

model DescribeVodRefreshTasksResponseBody = {
  pageNumber?: long(name='PageNumber', description='The page number of the returned page.', example='1'),
  pageSize?: long(name='PageSize', description='The number of entries returned per page.', example='10'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='174F6032-AA26-470D-****-36F0EB205BEE'),
  tasks?: {
    task?: [ 
    {
      creationTime?: string(name='CreationTime', description='The time when the task was created. The time follows the ISO 8601 standard in the *yyyy-MM-dd*T*HH:mm:ss*Z format. The time is displayed in UTC.', example='2014-11-27T08:23:22Z'),
      description?: string(name='Description', description='The type of error returned when the refresh or prefetch task failed. Valid values: Valid values:

*   **Internal Error**: An internal error occurred.
*   **Origin Timeout**: The response from the origin server timed out.
*   **Origin Return StatusCode 5XX**: The origin server returned an HTTP status code 5xx.', example='Internal Error'),
      objectPath?: string(name='ObjectPath', description='The URL of the object refreshed.', example='http://example.com/****.txt'),
      objectType?: string(name='ObjectType', description='The type of the task. Default value: file. Valid values:

*   **file**: refreshes one or more files.
*   **directory**: refreshes files in the specified directory.
*   **preload**: prefetches one or more files.', example='file'),
      process?: string(name='Process', description='The progress of the task in percentage.', example='100%'),
      status?: string(name='Status', description='The status of the task. Valid values:

*   **Complete**: The task is complete.
*   **Refreshing**: The task is in progress.
*   **Failed**: The task failed.
*   **Pending**: The task is pending.', example='Complete'),
      taskId?: string(name='TaskId', description='The ID of the task.', example='704225667'),
    }
  ](name='Task')
  }(name='Tasks', description='The information about the returned tasks.'),
  totalCount?: long(name='TotalCount', description='The total number of entries returned.', example='2'),
}

model DescribeVodRefreshTasksResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeVodRefreshTasksResponseBody(name='body'),
}

/**
 * @summary Queries the information about one or more refresh or prefetch tasks.
 *
 * @description *   This operation is available only in the **China (Shanghai)** region.
 * *   If you do not specify the TaskId or ObjectPath parameter, the data in the last three days is returned on the first page. By default, one page displays a maximum of 20 entries. You can specify the TaskId and ObjectPath parameters at the same time.
 *
 * @param request DescribeVodRefreshTasksRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeVodRefreshTasksResponse
 */
async function describeVodRefreshTasksWithOptions(request: DescribeVodRefreshTasksRequest, runtime: $RuntimeOptions): DescribeVodRefreshTasksResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.domainName)) {
    query['DomainName'] = request.domainName;
  }
  if (!$isNull(request.endTime)) {
    query['EndTime'] = request.endTime;
  }
  if (!$isNull(request.objectPath)) {
    query['ObjectPath'] = request.objectPath;
  }
  if (!$isNull(request.objectType)) {
    query['ObjectType'] = request.objectType;
  }
  if (!$isNull(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!$isNull(request.pageNumber)) {
    query['PageNumber'] = request.pageNumber;
  }
  if (!$isNull(request.pageSize)) {
    query['PageSize'] = request.pageSize;
  }
  if (!$isNull(request.securityToken)) {
    query['SecurityToken'] = request.securityToken;
  }
  if (!$isNull(request.startTime)) {
    query['StartTime'] = request.startTime;
  }
  if (!$isNull(request.status)) {
    query['Status'] = request.status;
  }
  if (!$isNull(request.taskId)) {
    query['TaskId'] = request.taskId;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'DescribeVodRefreshTasks',
    version = '2017-03-21',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Queries the information about one or more refresh or prefetch tasks.
 *
 * @description *   This operation is available only in the **China (Shanghai)** region.
 * *   If you do not specify the TaskId or ObjectPath parameter, the data in the last three days is returned on the first page. By default, one page displays a maximum of 20 entries. You can specify the TaskId and ObjectPath parameters at the same time.
 *
 * @param request DescribeVodRefreshTasksRequest
 * @return DescribeVodRefreshTasksResponse
 */
async function describeVodRefreshTasks(request: DescribeVodRefreshTasksRequest): DescribeVodRefreshTasksResponse {
  var runtime = new $RuntimeOptions{};
  return describeVodRefreshTasksWithOptions(request, runtime);
}

model DescribeVodSSLCertificateListRequest {
  domainName?: string(name='DomainName', description='The accelerated domain name.', example='example.com'),
  ownerId?: long(name='OwnerId'),
  pageNumber?: long(name='PageNumber', description='The page number. Default value: 1.', example='1'),
  pageSize?: long(name='PageSize', description='The number of entries per page. Valid values: integers from 1 to 1000.', example='10'),
  searchKeyword?: string(name='SearchKeyword', description='The keyword that is used to query certificates.', example='certabc'),
  securityToken?: string(name='SecurityToken'),
}

model DescribeVodSSLCertificateListResponseBody = {
  certificateListModel?: {
    certList?: {
      cert?: [ 
      {
        certId?: long(name='CertId', description='The ID of the certificate.', example='235437'),
        certName?: string(name='CertName', description='The name of the certificate.', example='video-ssl'),
        certRegion?: string(name='CertRegion', description='The region of the certificate. Valid values: **cn-hangzhou** and **ap-southeast-1**. Default value: **cn-hangzhou**.', example='cn-hangzhou'),
        common?: string(name='Common', description='The Common Name (CN) attribute of the certificate. In most cases, the CN is a domain name.', example='test'),
        fingerprint?: string(name='Fingerprint', description='The fingerprint of the certificate.', example='****'),
        issuer?: string(name='Issuer', description='The certificate authority (CA) that issued the certificate.', example='****'),
        lastTime?: long(name='LastTime', description='The time when the certificate was last modified. Unit: milliseconds.', example='1512388610'),
      }
    ](name='Cert')
    }(name='CertList', description='The list of certificates.'),
    count?: int32(name='Count', description='The number of certificates that are returned.', example='2'),
    pageNumber?: long(name='PageNumber', description='The page number. Pages start from page 1. Default value: 1.', example='1'),
    pageSize?: long(name='PageSize', description='The number of entries per page. Valid values: integers from 1 to 1000.', example='20'),
  }(name='CertificateListModel', description='The information about certificates.'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='25818875-5F78-4AF6-D7393642CA58****'),
}

model DescribeVodSSLCertificateListResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeVodSSLCertificateListResponseBody(name='body'),
}

/**
 * @summary Queries the certificates by domain name.
 *
 * @param request DescribeVodSSLCertificateListRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeVodSSLCertificateListResponse
 */
async function describeVodSSLCertificateListWithOptions(request: DescribeVodSSLCertificateListRequest, runtime: $RuntimeOptions): DescribeVodSSLCertificateListResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.domainName)) {
    query['DomainName'] = request.domainName;
  }
  if (!$isNull(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!$isNull(request.pageNumber)) {
    query['PageNumber'] = request.pageNumber;
  }
  if (!$isNull(request.pageSize)) {
    query['PageSize'] = request.pageSize;
  }
  if (!$isNull(request.searchKeyword)) {
    query['SearchKeyword'] = request.searchKeyword;
  }
  if (!$isNull(request.securityToken)) {
    query['SecurityToken'] = request.securityToken;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'DescribeVodSSLCertificateList',
    version = '2017-03-21',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Queries the certificates by domain name.
 *
 * @param request DescribeVodSSLCertificateListRequest
 * @return DescribeVodSSLCertificateListResponse
 */
async function describeVodSSLCertificateList(request: DescribeVodSSLCertificateListRequest): DescribeVodSSLCertificateListResponse {
  var runtime = new $RuntimeOptions{};
  return describeVodSSLCertificateListWithOptions(request, runtime);
}

model DescribeVodStorageDataRequest {
  appId?: string(name='AppId', description='The ID of the application. 

*   Default value: **app-1000000**.', example='app-1000000'),
  endTime?: string(name='EndTime', description='The end of the time range to query. The end time must be later than the start time. Specify the time in the ISO 8601 standard in the *yyyy-MM-dd*T*HH:mm:ss*Z format. The time must be in UTC.

This parameter is required.', example='2019-02-01T15:00:00Z'),
  ownerId?: long(name='OwnerId'),
  region?: string(name='Region', description='The region in which you want to query storage data. If you leave this parameter empty, data in all regions is returned. Separate multiple regions with commas (,). Valid values:

*   **cn-shanghai**: China (Shanghai)
*   **cn-beijing**: China (Beijing)
*   **eu-central-1**: Germany (Frankfurt)
*   **ap-southeast-1**: Singapore', example='cn-shanghai'),
  startTime?: string(name='StartTime', description='The beginning of the time range to query. Specify the time in the ISO 8601 standard in the *yyyy-MM-dd*T*HH:mm:ss*Z format. The time must be in UTC.

This parameter is required.', example='2019-02-01T14:00:00Z'),
  storage?: string(name='Storage', description='The name of the Object Storage Service (OSS) bucket. If you leave this parameter empty, data of all buckets is returned. Separate multiple transcoding specifications with commas (,).', example='bucket'),
  storageType?: string(name='StorageType', description='The storage class. Set the value to **OSS**.', example='OSS'),
}

model DescribeVodStorageDataResponseBody = {
  dataInterval?: string(name='DataInterval', description='The time granularity at which the data was queried. Valid values:

*   **hour**
*   **day**', example='day'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='C370DAF1-C838-4288-****-9A87633D248E'),
  storageData?: {
    storageDataItem?: [ 
    {
      networkOut?: string(name='NetworkOut', description='The outbound traffic. Unit: bytes. The outbound traffic is generated when videos are directly downloaded or played from OSS buckets without Alibaba Cloud CDN acceleration.', example='111111'),
      storageUtilization?: string(name='StorageUtilization', description='The detailed usage data of storage-related resources. Unit: bytes.', example='111111'),
      timeStamp?: string(name='TimeStamp', description='The timestamp of the returned data. The time follows the ISO 8601 standard in the *yyyy-MM-dd*T*HH:mm:ss*Z format. The time is displayed in UTC.', example='2019-02-01T15:00:00Z'),
    }
  ](name='StorageDataItem')
  }(name='StorageData', description='The storage usage data returned.'),
}

model DescribeVodStorageDataResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeVodStorageDataResponseBody(name='body'),
}

/**
 * @summary Queries the usage of storage-related resources, including the storage volume and outbound traffic.
 *
 * @description > *   This operation is available only in the **China (Shanghai)** region.
 * >*   If the time range to query is less than or equal to seven days, the system returns the statistics collected on an hourly basis. If the time range to query is greater than seven days, the system returns the statistics collected on a daily basis. The maximum time range that you can specify to query is 31 days.
 *
 * @param request DescribeVodStorageDataRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeVodStorageDataResponse
 */
async function describeVodStorageDataWithOptions(request: DescribeVodStorageDataRequest, runtime: $RuntimeOptions): DescribeVodStorageDataResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.appId)) {
    query['AppId'] = request.appId;
  }
  if (!$isNull(request.endTime)) {
    query['EndTime'] = request.endTime;
  }
  if (!$isNull(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!$isNull(request.region)) {
    query['Region'] = request.region;
  }
  if (!$isNull(request.startTime)) {
    query['StartTime'] = request.startTime;
  }
  if (!$isNull(request.storage)) {
    query['Storage'] = request.storage;
  }
  if (!$isNull(request.storageType)) {
    query['StorageType'] = request.storageType;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'DescribeVodStorageData',
    version = '2017-03-21',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Queries the usage of storage-related resources, including the storage volume and outbound traffic.
 *
 * @description > *   This operation is available only in the **China (Shanghai)** region.
 * >*   If the time range to query is less than or equal to seven days, the system returns the statistics collected on an hourly basis. If the time range to query is greater than seven days, the system returns the statistics collected on a daily basis. The maximum time range that you can specify to query is 31 days.
 *
 * @param request DescribeVodStorageDataRequest
 * @return DescribeVodStorageDataResponse
 */
async function describeVodStorageData(request: DescribeVodStorageDataRequest): DescribeVodStorageDataResponse {
  var runtime = new $RuntimeOptions{};
  return describeVodStorageDataWithOptions(request, runtime);
}

model DescribeVodTieringStorageDataRequest {
  appId?: string(name='AppId'),
  endTime?: string(name='EndTime', description='The end time at which data is obtained. The end time must be later than the start time. The difference cannot exceed 31 days. Specify the time in the ISO 8601 standard in the *yyyy-MM-dd*T*HH:mm:ss*Z format. The time must be in UTC.', example='2023-05-29T02:00:00Z'),
  ownerId?: long(name='OwnerId'),
  region?: string(name='Region', description='The region in which you want to query data. If you leave this parameter empty, data in all regions is returned. Separate multiple regions with commas (,).', example='cn-beijing'),
  startTime?: string(name='StartTime', description='The beginning of the time range to query. Specify the time in the ISO 8601 standard in the yyyy-MM-ddTHH:mm:ssZ format. The time must be in UTC. If you leave this parameter empty, data in the last 24 hours is queried.', example='2023-05-29T01:00:00Z'),
  storageClass?: string(name='StorageClass', description='The storage type. By default, all storage types are returned. Valid values:

*   **IA**
*   **Archive**
*   **ColdArchive**', example='IA'),
}

model DescribeVodTieringStorageDataResponseBody = {
  requestId?: string(name='RequestId', description='The ID of the request.', example='25818875-5F78-4AF6-D7393642CA58****'),
  storageData?: [ 
    {
      lessthanMonthDatasize?: long(name='LessthanMonthDatasize', description='The data that is stored less than a month. Unit: bytes.', example='123'),
      region?: string(name='Region', description='The region in which data is queried.', example='cn-beijing'),
      storageClass?: string(name='StorageClass', description='The storage type.', example='IA'),
      storageUtilization?: long(name='StorageUtilization', description='The storage usage. Unit: bytes.', example='1234'),
      timeStamp?: string(name='TimeStamp', description='The timestamp of the data returned. The time follows the ISO 8601 standard in the *yyyy-MM-dd*T*HH:mm:ss*Z format. The time is displayed in UTC.', example='2023-05-29T01:00:00Z'),
    }
  ](name='StorageData', description='The storage usage data returned.'),
}

model DescribeVodTieringStorageDataResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeVodTieringStorageDataResponseBody(name='body'),
}

/**
 * @summary Queries the usage of tiered storage for media assets.
 *
 * @description *   This operation is available only in the **China (Shanghai)** region.
 * *   If you specify a time range within 7 days, the request returns the data based on hours. If you specify a time range longer than 7 days, the request returns the data based on days. The maximum time range is 31 days.
 *
 * @param request DescribeVodTieringStorageDataRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeVodTieringStorageDataResponse
 */
async function describeVodTieringStorageDataWithOptions(request: DescribeVodTieringStorageDataRequest, runtime: $RuntimeOptions): DescribeVodTieringStorageDataResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.appId)) {
    query['AppId'] = request.appId;
  }
  if (!$isNull(request.endTime)) {
    query['EndTime'] = request.endTime;
  }
  if (!$isNull(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!$isNull(request.region)) {
    query['Region'] = request.region;
  }
  if (!$isNull(request.startTime)) {
    query['StartTime'] = request.startTime;
  }
  if (!$isNull(request.storageClass)) {
    query['StorageClass'] = request.storageClass;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'DescribeVodTieringStorageData',
    version = '2017-03-21',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Queries the usage of tiered storage for media assets.
 *
 * @description *   This operation is available only in the **China (Shanghai)** region.
 * *   If you specify a time range within 7 days, the request returns the data based on hours. If you specify a time range longer than 7 days, the request returns the data based on days. The maximum time range is 31 days.
 *
 * @param request DescribeVodTieringStorageDataRequest
 * @return DescribeVodTieringStorageDataResponse
 */
async function describeVodTieringStorageData(request: DescribeVodTieringStorageDataRequest): DescribeVodTieringStorageDataResponse {
  var runtime = new $RuntimeOptions{};
  return describeVodTieringStorageDataWithOptions(request, runtime);
}

model DescribeVodTieringStorageRetrievalDataRequest {
  appId?: string(name='AppId'),
  endTime?: string(name='EndTime', description='The end of the time range to query. The end time must be later than the start time. The time range cannot exceed 31 days. Specify the time in the ISO 8601 standard in the *yyyy-MM-dd*T*HH:mm:ss*Z format. The time must be in UTC.', example='2023-06-02T11:20:00Z'),
  ownerId?: long(name='OwnerId'),
  region?: string(name='Region', description='The region in which you want to query data. If you leave this parameter empty, data in all regions is returned. Separate multiple regions with commas (,).', example='cn-beijing'),
  startTime?: string(name='StartTime', description='The beginning of the time range to query. Specify the time in the ISO 8601 standard in the yyyy-MM-ddTHH:mm:ssZ format. The time must be in UTC. The minimum time range is 5 minutes. If you leave this parameter empty, data in the last 24 hours is queried.', example='2023-06-02T10:20:00Z'),
  storageClass?: string(name='StorageClass', description='The storage type. Valid values:

*   **IA**
*   **Archive**
*   **ColdArchive**', example='IA'),
}

model DescribeVodTieringStorageRetrievalDataResponseBody = {
  requestId?: string(name='RequestId', description='The ID of the request.', example='25818875-5F78-4A13-BEF6-D73936****'),
  retrievalData?: [ 
    {
      CABulkRetrievalData?: long(name='CABulkRetrievalData', description='The retrieved Cold Archive data in the bulk mode.', example='123'),
      CAHighPriorRetrievalData?: long(name='CAHighPriorRetrievalData', description='The retrieved Cold Archive data in the expedited mode.', example='123'),
      CAStdRetrievalData?: long(name='CAStdRetrievalData', description='The retrieved Cold Archive data in the standard mode.', example='123'),
      region?: string(name='Region', description='The storage region.', example='cn-beijing'),
      retrievalData?: long(name='RetrievalData', description='The data retrieval information.', example='1234'),
      storageClass?: string(name='StorageClass', description='The storage type.', example='IA'),
      timeStamp?: string(name='TimeStamp', description='The timestamp of the returned data. The time follows the ISO 8601 standard in the *yyyy-MM-dd*T*HH:mm:ss*Z format. The time is displayed in UTC.', example='2023-06-02T10:20:00Z'),
    }
  ](name='RetrievalData', description='The data retrieval information.'),
}

model DescribeVodTieringStorageRetrievalDataResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeVodTieringStorageRetrievalDataResponseBody(name='body'),
}

/**
 * @summary Queries the data retrieval from tiered storage.
 *
 * @description *   This operation is available only in the **China (Shanghai)** region.
 * *   If you specify a time range within 7 days, the request returns the data based on hours. If you specify a time range longer than 7 days, the request returns the data based on days. The maximum time range is 31 days.
 *
 * @param request DescribeVodTieringStorageRetrievalDataRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeVodTieringStorageRetrievalDataResponse
 */
async function describeVodTieringStorageRetrievalDataWithOptions(request: DescribeVodTieringStorageRetrievalDataRequest, runtime: $RuntimeOptions): DescribeVodTieringStorageRetrievalDataResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.appId)) {
    query['AppId'] = request.appId;
  }
  if (!$isNull(request.endTime)) {
    query['EndTime'] = request.endTime;
  }
  if (!$isNull(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!$isNull(request.region)) {
    query['Region'] = request.region;
  }
  if (!$isNull(request.startTime)) {
    query['StartTime'] = request.startTime;
  }
  if (!$isNull(request.storageClass)) {
    query['StorageClass'] = request.storageClass;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'DescribeVodTieringStorageRetrievalData',
    version = '2017-03-21',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Queries the data retrieval from tiered storage.
 *
 * @description *   This operation is available only in the **China (Shanghai)** region.
 * *   If you specify a time range within 7 days, the request returns the data based on hours. If you specify a time range longer than 7 days, the request returns the data based on days. The maximum time range is 31 days.
 *
 * @param request DescribeVodTieringStorageRetrievalDataRequest
 * @return DescribeVodTieringStorageRetrievalDataResponse
 */
async function describeVodTieringStorageRetrievalData(request: DescribeVodTieringStorageRetrievalDataRequest): DescribeVodTieringStorageRetrievalDataResponse {
  var runtime = new $RuntimeOptions{};
  return describeVodTieringStorageRetrievalDataWithOptions(request, runtime);
}

model DescribeVodTranscodeDataRequest {
  appId?: string(name='AppId', description='The ID of the application. You can specify this parameter to query the transcoding statistics of a specific application. By default, the transcoding statistics of all applications is returned. You can obtain the application ID from the `AppId` parameter in the response to the [CreateAppInfo](~~CreateAppInfo~~) operation.', example='app-1000001'),
  endTime?: string(name='EndTime', description='The end of the time range to query. The end time must be later than the start time. Specify the time in the ISO 8601 standard in the *yyyy-MM-dd*T*HH:mm:ss*Z format. The time must be in UTC.

This parameter is required.', example='2019-02-01T15:59:00Z'),
  interval?: string(name='Interval', description='The interval at which you want to query data. Valid values:

*   **day**: days
*   **hour**: hours', example='day'),
  ownerId?: long(name='OwnerId'),
  region?: string(name='Region', description='The region in which you want to query data. If you leave this parameter empty, data in all regions is returned. Separate multiple regions with commas (,). Valid values:

*   **cn-shanghai**: China (Shanghai)
*   **cn-beijing**: China (Beijing)
*   **eu-central-1**: Germany (Frankfurt)
*   **ap-southeast-1**: Singapore', example='cn-shanghai'),
  specification?: string(name='Specification', description='The transcoding specification. If you leave this parameter empty, data of all transcoding specifications is returned. Separate multiple transcoding specifications with commas (,). Valid values:

*   **Audio**: audio transcoding
*   **Segmentation**: container format conversion
*   **H264.LD**, **H264.SD**, **H264.HD**, **H264.2K**, **H264.4K**, and more', example='Audio'),
  startTime?: string(name='StartTime', description='The beginning of the time range to query. Specify the time in the ISO 8601 standard in the *yyyy-MM-dd*T*HH:mm:ss*Z format. The time must be in UTC.

This parameter is required.', example='2019-02-01T15:00:00Z'),
  storage?: string(name='Storage', description='The name of the Object Storage Service (OSS) bucket. If you leave this parameter empty, data of all buckets is returned. Separate multiple bucket names with commas (,).', example='bucket01'),
}

model DescribeVodTranscodeDataResponseBody = {
  dataInterval?: string(name='DataInterval', description='The interval at which the data was queried. Valid values:

*   **hour**
*   **day**', example='day'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='C370DAF1-C838-4288-****-9A87633D248E'),
  transcodeData?: {
    transcodeDataItem?: [ 
    {
      data?: {
        dataItem?: [ 
        {
          name?: string(name='Name', description='The transcoding specification. Valid values:

*   **Audio**: audio transcoding
*   **Segmentation**: container format conversion
*   **H264.LD, H264.SD, H264.HD, H264.2K, H264.4K, and more**', example='H264.SD'),
          value?: string(name='Value', description='The transcoding duration. Unit: seconds.', example='111'),
        }
      ](name='DataItem')
      }(name='Data', description='The statistics on transcoding of different specifications.'),
      timeStamp?: string(name='TimeStamp', description='The timestamp of the returned data. The time follows the ISO 8601 standard in the *yyyy-MM-dd*T*HH:mm:ss*Z format. The time is displayed in UTC.', example='2019-02-01T16:00:00Z'),
    }
  ](name='TranscodeDataItem')
  }(name='TranscodeData', description='The transcoding statistics returned.'),
}

model DescribeVodTranscodeDataResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeVodTranscodeDataResponseBody(name='body'),
}

/**
 * @summary Queries the transcoding statistics.
 *
 * @description *   This operation is available only in the **China (Shanghai)** region.
 * *   If the time range to query is less than or equal to seven days, the system returns the statistics collected on an hourly basis. If the time range to query is greater than seven days, the system returns the statistics collected on a daily basis. The maximum time range that you can specify to query is 31 days.
 *
 * @param request DescribeVodTranscodeDataRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeVodTranscodeDataResponse
 */
async function describeVodTranscodeDataWithOptions(request: DescribeVodTranscodeDataRequest, runtime: $RuntimeOptions): DescribeVodTranscodeDataResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.appId)) {
    query['AppId'] = request.appId;
  }
  if (!$isNull(request.endTime)) {
    query['EndTime'] = request.endTime;
  }
  if (!$isNull(request.interval)) {
    query['Interval'] = request.interval;
  }
  if (!$isNull(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!$isNull(request.region)) {
    query['Region'] = request.region;
  }
  if (!$isNull(request.specification)) {
    query['Specification'] = request.specification;
  }
  if (!$isNull(request.startTime)) {
    query['StartTime'] = request.startTime;
  }
  if (!$isNull(request.storage)) {
    query['Storage'] = request.storage;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'DescribeVodTranscodeData',
    version = '2017-03-21',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Queries the transcoding statistics.
 *
 * @description *   This operation is available only in the **China (Shanghai)** region.
 * *   If the time range to query is less than or equal to seven days, the system returns the statistics collected on an hourly basis. If the time range to query is greater than seven days, the system returns the statistics collected on a daily basis. The maximum time range that you can specify to query is 31 days.
 *
 * @param request DescribeVodTranscodeDataRequest
 * @return DescribeVodTranscodeDataResponse
 */
async function describeVodTranscodeData(request: DescribeVodTranscodeDataRequest): DescribeVodTranscodeDataResponse {
  var runtime = new $RuntimeOptions{};
  return describeVodTranscodeDataWithOptions(request, runtime);
}

model DescribeVodUserDomainsRequest {
  domainName?: string(name='DomainName', description='The domain name. The value of this parameter is used as a filter condition for a fuzzy match.', example='example.aliyundoc.com'),
  domainSearchType?: string(name='DomainSearchType', description='The search method. Valid values:

*   **fuzzy_match** (default): fuzzy match.
*   **pre_match**: prefix match
*   **suf_match**: suffix match
*   **full_match**: exact match', example='fuzzy_match'),
  domainStatus?: string(name='DomainStatus', description='The status of the domain name. Value values:

*   **online**: indicates that the domain name is enabled.
*   **offline**: indicates that the domain name is disabled.
*   **configuring**: indicates that the domain name is being configured.
*   **configure_failed**: indicates that the domain name failed to be configured.
*   **checking**: indicates that the domain name is under review.
*   **check_failed**: indicates that the domain name failed the review.', example='online'),
  ownerId?: long(name='OwnerId'),
  pageNumber?: int32(name='PageNumber', description='The page number.', example='1'),
  pageSize?: int32(name='PageSize', description='The number of entries per page. Default value: **20**. Maximum value: **50**. Valid values: **1** to **50**.', example='20'),
  securityToken?: string(name='SecurityToken'),
  tag?: [ 
    {
      key?: string(name='Key', description='The key of tag N. Valid values of N: **1** to **20**.

By default, all tag keys are queried.', example='key'),
      value?: string(name='Value', description='The value of tag N. Valid values of N: **1** to **20**.

By default, all tag values are queried.', example='value'),
    }
  ](name='Tag', description='The tags.'),
}

model DescribeVodUserDomainsResponseBody = {
  domains?: {
    pageData?: [ 
    {
      cname?: string(name='Cname', description='The CNAME that is assigned to the domain name for CDN.', example='learn.developer.aliyundoc.com'),
      description?: string(name='Description', description='The remarks.', example='Zhejiang ICP Filing No. ****'),
      domainName?: string(name='DomainName', description='The domain name for CDN.', example='example.aliyundoc.com'),
      domainStatus?: string(name='DomainStatus', description='The status of the domain name for CDN. Valid values:

*   **online**: indicates that the domain name is enabled.
*   **offline**: indicates that the domain name is disabled.
*   **configuring**: indicates that the domain name is being configured.
*   **configure_failed**: indicates that the domain name failed to be configured.
*   **checking**: indicates that the domain name is under review.
*   **check_failed**: indicates that the domain name failed the review.', example='online'),
      gmtCreated?: string(name='GmtCreated', description='The time when the domain name for CDN was added. The time is in the *yyyy-MM-dd*T*HH:mm:ss*Z format. The time is displayed in UTC.', example='2017-08-29T08:40:53Z'),
      gmtModified?: string(name='GmtModified', description='The last time when the domain name for CDN was modified. The time is in the *yyyy-MM-dd*T*HH:mm:ss*Z format. The time is displayed in UTC.', example='2017-12-29T09:24:12Z'),
      sandbox?: string(name='Sandbox', description='Indicates whether the accelerated domain name was in a sandbox.', example='normal'),
      sources?: {
        source?: [ 
        {
          content?: string(name='Content', description='The address of the origin server.', example='192.168.0.1'),
          port?: int32(name='Port', description='The port number. Valid values: **443** and **80**.', example='80'),
          priority?: string(name='Priority', description='The priority of the origin server.', example='5'),
          type?: string(name='Type', description='The type of the origin server. Valid values:

*   **ipaddr**: an IP address.
*   **domain**: an origin domain name
*   **oss**: the OSS domain of an Object Storage Service (OSS) bucket', example='oss'),
        }
      ](name='Source')
      }(name='Sources', description='The information about the origin server.'),
      sslProtocol?: string(name='SslProtocol', description='Indicates whether HTTPS is enabled.

*   **on**: HTTPS is enabled.
*   **off**: HTTPS is not eabled.', example='on'),
    }
  ](name='PageData')
  }(name='Domains', description='The detailed information about each domain name for CDN. The returned information is displayed in the format that is specified by the PageData parameter.'),
  pageNumber?: long(name='PageNumber', description='The page number.', example='1'),
  pageSize?: long(name='PageSize', description='The number of entries per page.', example='20'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='E4EBD2BF-5EB0-4476-****-9D94E1B15267'),
  totalCount?: long(name='TotalCount', description='The total number of entries.', example='2'),
}

model DescribeVodUserDomainsResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeVodUserDomainsResponseBody(name='body'),
}

/**
 * @summary Queries the domain names for CDN within your Alibaba Cloud account.
 *
 * @description *   You can filter domain names by name and status. Fuzzy match is supported for domain name-based query.
 * *   This operation is available only in the China (Shanghai) region.
 *
 * @param request DescribeVodUserDomainsRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeVodUserDomainsResponse
 */
async function describeVodUserDomainsWithOptions(request: DescribeVodUserDomainsRequest, runtime: $RuntimeOptions): DescribeVodUserDomainsResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.domainName)) {
    query['DomainName'] = request.domainName;
  }
  if (!$isNull(request.domainSearchType)) {
    query['DomainSearchType'] = request.domainSearchType;
  }
  if (!$isNull(request.domainStatus)) {
    query['DomainStatus'] = request.domainStatus;
  }
  if (!$isNull(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!$isNull(request.pageNumber)) {
    query['PageNumber'] = request.pageNumber;
  }
  if (!$isNull(request.pageSize)) {
    query['PageSize'] = request.pageSize;
  }
  if (!$isNull(request.securityToken)) {
    query['SecurityToken'] = request.securityToken;
  }
  if (!$isNull(request.tag)) {
    query['Tag'] = request.tag;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'DescribeVodUserDomains',
    version = '2017-03-21',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Queries the domain names for CDN within your Alibaba Cloud account.
 *
 * @description *   You can filter domain names by name and status. Fuzzy match is supported for domain name-based query.
 * *   This operation is available only in the China (Shanghai) region.
 *
 * @param request DescribeVodUserDomainsRequest
 * @return DescribeVodUserDomainsResponse
 */
async function describeVodUserDomains(request: DescribeVodUserDomainsRequest): DescribeVodUserDomainsResponse {
  var runtime = new $RuntimeOptions{};
  return describeVodUserDomainsWithOptions(request, runtime);
}

model DescribeVodVerifyContentRequest {
  domainName?: string(name='DomainName', description='The domain name for which you want to verify the ownership. You can specify only one domain name in each call.

This parameter is required.', example='example.com'),
  ownerId?: long(name='OwnerId'),
}

model DescribeVodVerifyContentResponseBody = {
  content?: string(name='Content', description='The verification content.', example='verify_dffeb661*****3a59c31cd91f'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='34AB41F1-04A5-4688-634BDBE6****'),
}

model DescribeVodVerifyContentResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeVodVerifyContentResponseBody(name='body'),
}

/**
 * @summary Queries the ownership verification content.
 *
 * @description *   This operation is available only in the **China (Shanghai)** region.
 *
 * @param request DescribeVodVerifyContentRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeVodVerifyContentResponse
 */
async function describeVodVerifyContentWithOptions(request: DescribeVodVerifyContentRequest, runtime: $RuntimeOptions): DescribeVodVerifyContentResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.domainName)) {
    query['DomainName'] = request.domainName;
  }
  if (!$isNull(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'DescribeVodVerifyContent',
    version = '2017-03-21',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Queries the ownership verification content.
 *
 * @description *   This operation is available only in the **China (Shanghai)** region.
 *
 * @param request DescribeVodVerifyContentRequest
 * @return DescribeVodVerifyContentResponse
 */
async function describeVodVerifyContent(request: DescribeVodVerifyContentRequest): DescribeVodVerifyContentResponse {
  var runtime = new $RuntimeOptions{};
  return describeVodVerifyContentWithOptions(request, runtime);
}

model DetachAppPolicyFromIdentityRequest {
  appId?: string(name='AppId', description='The ID of the application. This parameter is optional if you set PolicyNames to VODAppAdministratorAccess. This parameter is required if you set PolicyNames to a value other than VODAppAdministratorAccess.

*   Default value: **app-1000000**.
*   For more information, see [Overview](https://help.aliyun.com/document_detail/113600.html).', example='app-****'),
  identityName?: string(name='IdentityName', description='The ID of the RAM user or the name of the RAM role.

*   Specifies the ID of the RAM user for this parameter if you set IdentityType to RamUser.
*   Specifies the name of the RAM role for this parameter if you set IdentityType to RamRole.

This parameter is required.', example='test****name'),
  identityType?: string(name='IdentityType', description='The type of the identity. Valid values:

*   **RamUser**: RAM user
*   **RamRole**: RAM role

This parameter is required.', example='RamUser'),
  policyNames?: string(name='PolicyNames', description='The name of the policy. Separate multiple names with commas (,). Only system policies are supported.

*   **VODAppFullAccess**: permissions to manage all resources in an application
*   **VODAppReadOnlyAccess**: permissions to read all resources in an application
*   **VODAppAdministratorAccess**: permissions of the application administrator

This parameter is required.', example='VODAppFullAccess'),
}

model DetachAppPolicyFromIdentityResponseBody = {
  failedPolicyNames?: [ string ](name='FailedPolicyNames', description='The names of the policies that failed to be granted to the RAM user or RAM role.'),
  nonExistPolicyNames?: [ string ](name='NonExistPolicyNames', description='The name of the policy that was not found.'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='25818875-5F78-4A13-****-D7393642C'),
}

model DetachAppPolicyFromIdentityResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DetachAppPolicyFromIdentityResponseBody(name='body'),
}

/**
 * @summary Revokes application permissions from the specified identity. The identity may a RAM user or RAM role.
 *
 * @description >  You can grant a maximum of 10 application permissions to a RAM user or RAM role.
 *
 * @param request DetachAppPolicyFromIdentityRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DetachAppPolicyFromIdentityResponse
 */
async function detachAppPolicyFromIdentityWithOptions(request: DetachAppPolicyFromIdentityRequest, runtime: $RuntimeOptions): DetachAppPolicyFromIdentityResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.appId)) {
    query['AppId'] = request.appId;
  }
  if (!$isNull(request.identityName)) {
    query['IdentityName'] = request.identityName;
  }
  if (!$isNull(request.identityType)) {
    query['IdentityType'] = request.identityType;
  }
  if (!$isNull(request.policyNames)) {
    query['PolicyNames'] = request.policyNames;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'DetachAppPolicyFromIdentity',
    version = '2017-03-21',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Revokes application permissions from the specified identity. The identity may a RAM user or RAM role.
 *
 * @description >  You can grant a maximum of 10 application permissions to a RAM user or RAM role.
 *
 * @param request DetachAppPolicyFromIdentityRequest
 * @return DetachAppPolicyFromIdentityResponse
 */
async function detachAppPolicyFromIdentity(request: DetachAppPolicyFromIdentityRequest): DetachAppPolicyFromIdentityResponse {
  var runtime = new $RuntimeOptions{};
  return detachAppPolicyFromIdentityWithOptions(request, runtime);
}

model GenerateDownloadSecretKeyRequest {
  appDecryptKey?: string(name='AppDecryptKey', description='A custom string of 16 to 32 characters in length. The string must contain uppercase letters, lowercase letters, and digits.

This parameter is required.', example='AppDecryptKeyAndroid20230101'),
  appIdentification?: string(name='AppIdentification', description='The unique identifier of the app.

*   Android: the SHA-1 fingerprint of the keystore. The value is a string that contains a colon (:).
*   iOS: the bundle ID of the app.
*   Windows: the serial number in the digital signature certificate.

For more information about how to obtain the unique identifier of an app, see [Obtain the unique app identifier](~~86107#section-wtj-9d7-lg2~~).

This parameter is required.', example='BB:0D:AC:74:D3:21:09:EF:9C:71:1A:5E:77:2C:8E:BF:03:FD:FA:5A'),
  ownerId?: long(name='OwnerId'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
}

model GenerateDownloadSecretKeyResponseBody = {
  appEncryptKey?: string(name='AppEncryptKey', description='The key file for secure download.', example='***'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='E99B9BAD-7F9D-552B-A689-B72E92EA040E'),
}

model GenerateDownloadSecretKeyResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: GenerateDownloadSecretKeyResponseBody(name='body'),
}

/**
 * @summary Generates a key for secure download. ApsaraVideo Player SDK provides the secure download feature. Videos that are downloaded to your local device in this mode are encrypted. You can play the encrypted videos only by using the key file generated from the app that you specified. Secure download protects your videos from malicious playback or distribution.
 *
 * @description *   To use the secure download feature, you must enable the download feature in the ApsaraVideo VOD console and set the download method to secure download. For more information, see [Configure download settings](https://help.aliyun.com/document_detail/86107.html).
 * *   After you generate a key for secure download, you must configure the key in ApsaraVideo Player SDK. For more information, see [Secure download](https://help.aliyun.com/document_detail/124735.html).
 *
 * @param request GenerateDownloadSecretKeyRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return GenerateDownloadSecretKeyResponse
 */
async function generateDownloadSecretKeyWithOptions(request: GenerateDownloadSecretKeyRequest, runtime: $RuntimeOptions): GenerateDownloadSecretKeyResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.appDecryptKey)) {
    query['AppDecryptKey'] = request.appDecryptKey;
  }
  if (!$isNull(request.appIdentification)) {
    query['AppIdentification'] = request.appIdentification;
  }
  if (!$isNull(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!$isNull(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!$isNull(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'GenerateDownloadSecretKey',
    version = '2017-03-21',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Generates a key for secure download. ApsaraVideo Player SDK provides the secure download feature. Videos that are downloaded to your local device in this mode are encrypted. You can play the encrypted videos only by using the key file generated from the app that you specified. Secure download protects your videos from malicious playback or distribution.
 *
 * @description *   To use the secure download feature, you must enable the download feature in the ApsaraVideo VOD console and set the download method to secure download. For more information, see [Configure download settings](https://help.aliyun.com/document_detail/86107.html).
 * *   After you generate a key for secure download, you must configure the key in ApsaraVideo Player SDK. For more information, see [Secure download](https://help.aliyun.com/document_detail/124735.html).
 *
 * @param request GenerateDownloadSecretKeyRequest
 * @return GenerateDownloadSecretKeyResponse
 */
async function generateDownloadSecretKey(request: GenerateDownloadSecretKeyRequest): GenerateDownloadSecretKeyResponse {
  var runtime = new $RuntimeOptions{};
  return generateDownloadSecretKeyWithOptions(request, runtime);
}

model GenerateKMSDataKeyRequest {
  ownerAccount?: string(name='OwnerAccount'),
  ownerId?: string(name='OwnerId'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: string(name='ResourceOwnerId'),
}

model GenerateKMSDataKeyResponseBody = {
  ciphertextBlob?: string(name='CiphertextBlob', description='The ciphertext of the encrypted data key. This is used as CipherText when you create a transcoding job.', example='ODZhOWVmZDktM2QxNi00ODk0LWJkNGYtMWZjNDNmM2YyYWJmS7FmDBBQ0BkKsQrtRnidtPwirmDcS0ZuJCU41xxAAWk4Z8qsADfbV0b+i6kQmlvj79dJdGOvtX69Uycs901qOjop4bTS****'),
  keyId?: string(name='KeyId', description='The ID of the customer master key (CMK). The ID must be globally unique.', example='7906979c-8e06-46a2-be2d-68e3ccbc****'),
  plaintext?: string(name='Plaintext', description='The Base64-encoded plaintext of the data key.', example='QmFzZTY0IGVuY29kZWQgcGxhaW50****'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='25818875-5F78-4A*****F6-D7393642CA58'),
}

model GenerateKMSDataKeyResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: GenerateKMSDataKeyResponseBody(name='body'),
}

/**
 * @summary Generates a random Key Management Service (KMS) data key used for HLS encryption in ApsaraVideo VOD.
 *
 * @param request GenerateKMSDataKeyRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return GenerateKMSDataKeyResponse
 */
async function generateKMSDataKeyWithOptions(request: GenerateKMSDataKeyRequest, runtime: $RuntimeOptions): GenerateKMSDataKeyResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.ownerAccount)) {
    query['OwnerAccount'] = request.ownerAccount;
  }
  if (!$isNull(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!$isNull(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!$isNull(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'GenerateKMSDataKey',
    version = '2017-03-21',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Generates a random Key Management Service (KMS) data key used for HLS encryption in ApsaraVideo VOD.
 *
 * @param request GenerateKMSDataKeyRequest
 * @return GenerateKMSDataKeyResponse
 */
async function generateKMSDataKey(request: GenerateKMSDataKeyRequest): GenerateKMSDataKeyResponse {
  var runtime = new $RuntimeOptions{};
  return generateKMSDataKeyWithOptions(request, runtime);
}

model GetAIImageJobsRequest {
  jobIds?: string(name='JobIds', description='The ID of the image AI processing job. You can obtain the value of JobId from the response to the [SubmitAIImageJob](~~SubmitAIImageJob~~) operation.
*   You can specify a maximum of 10 IDs.
*   Separate multiple IDs with commas (,).

This parameter is required.', example='cf08a2c6e11e*****de1711b738b9067'),
  ownerAccount?: string(name='OwnerAccount'),
  ownerId?: string(name='OwnerId'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: string(name='ResourceOwnerId'),
}

model GetAIImageJobsResponseBody = {
  AIImageJobList?: [ 
    {
      AIImageResult?: string(name='AIImageResult', description='The Object Storage Service (OSS) URL of the image file.

> This parameter does not include the complete authentication information. To obtain the authentication information, you must generate a signed URL. Alternatively, you can call the [ListAIImageInfo](~~ListAIImageInfo~~) operation to obtain the image information.', example='[{"Score":5.035636554444242,"Url":"http://outin-*****.oss-cn-shanghai.aliyuncs.com/357a8748c577*****789d2726e6436aa/image/ai/b0a7612554d*****5cbe3-00001.gif"}]'),
      code?: string(name='Code', description='The error code.', example='Success'),
      creationTime?: string(name='CreationTime', description='The time when the image AI processing job was created. The time follows the ISO 8601 standard in the *yyyy-MM-dd*T*HH:mm:ss*Z format. The time is displayed in UTC.', example='2020-10-15T03:30:03Z'),
      jobId?: string(name='JobId', description='The ID of the image AI processing job.', example='cf08a2c6e11e*****de1711b738b9067'),
      message?: string(name='Message', description='The error message.', example='success'),
      status?: string(name='Status', description='The status of the job. Valid values:

*   **success**
*   **fail**', example='success'),
      templateConfig?: string(name='TemplateConfig', description='The configurations of the AI template that was used to submit the job.', example='{"Format":"gif","SetDefaultCover":"true"}'),
      templateId?: string(name='TemplateId', description='The ID of the AI template.', example='5a86a00f15194*****d7fe7de1b4a173'),
      userData?: string(name='UserData', description='The user data.

*   The value must be a JSON string.
*   The MessageCallback or Extend parameter is returned.
*   The value contains a maximum of 512 bytes.

For more information, see the "UserData: specifies the custom configurations for media upload" section of the [Request parameters](https://help.aliyun.com/document_detail/86952.html) topic.', example='{"Extend":{"localId":"****","test":"www"}}'),
      videoId?: string(name='VideoId', description='The ID of the video.', example='357a8748c577*****789d2726e6436aa'),
    }
  ](name='AIImageJobList', description='The image AI processing jobs.'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='7721B494-1F78-4E*****E8-A7CEE7315BFA'),
}

model GetAIImageJobsResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: GetAIImageJobsResponseBody(name='body'),
}

/**
 * @summary Queries jobs of image AI processing.
 *
 * @description *   Regions that support this operation: **China (Beijing)** and **China (Shanghai)**.
 * *   Call the [SubmitAIImageJob](~~SubmitAIImageJob~~) operation to submit image AI processing jobs before you call this operation to query image AI processing jobs.
 * *   You can query a maximum of 10 jobs of image AI processing in one request.
 *
 * @param request GetAIImageJobsRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return GetAIImageJobsResponse
 */
async function getAIImageJobsWithOptions(request: GetAIImageJobsRequest, runtime: $RuntimeOptions): GetAIImageJobsResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.jobIds)) {
    query['JobIds'] = request.jobIds;
  }
  if (!$isNull(request.ownerAccount)) {
    query['OwnerAccount'] = request.ownerAccount;
  }
  if (!$isNull(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!$isNull(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!$isNull(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'GetAIImageJobs',
    version = '2017-03-21',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Queries jobs of image AI processing.
 *
 * @description *   Regions that support this operation: **China (Beijing)** and **China (Shanghai)**.
 * *   Call the [SubmitAIImageJob](~~SubmitAIImageJob~~) operation to submit image AI processing jobs before you call this operation to query image AI processing jobs.
 * *   You can query a maximum of 10 jobs of image AI processing in one request.
 *
 * @param request GetAIImageJobsRequest
 * @return GetAIImageJobsResponse
 */
async function getAIImageJobs(request: GetAIImageJobsRequest): GetAIImageJobsResponse {
  var runtime = new $RuntimeOptions{};
  return getAIImageJobsWithOptions(request, runtime);
}

model GetAIMediaAuditJobRequest {
  jobId?: string(name='JobId', description='The ID of the intelligent review job.

This parameter is required.', example='bdbc266af6894*****943a70176d92e9'),
}

model GetAIMediaAuditJobResponseBody = {
  mediaAuditJob?: {
    code?: string(name='Code', description='The error code. This parameter is returned if the value of Status is fail.', example='0'),
    completeTime?: string(name='CompleteTime', description='The time when the job is complete. The time follows the ISO 8601 standard in the *yyyy-MM-dd*T*HH:mm:ss*Z format. The time is displayed in UTC.', example='2017-01-11T13:00:00Z'),
    creationTime?: string(name='CreationTime', description='The time when the job started to run. The time follows the ISO 8601 standard in the *yyyy-MM-dd*T*HH:mm:ss*Z format. The time is displayed in UTC.', example='2017-01-11T12:00:00Z'),
    data?: {
      abnormalModules?: string(name='AbnormalModules', description='The content that violates the regulations. Separate multiple values with commas (,). Valid values:

*   **video**: the video.
*   **image-cover**: the cover.
*   **text-title**: the title.', example='video'),
      audioResult?: [ 
        {
          label?: string(name='Label', description='The category of the review result.

*   **normal**: normal content
*   **spam**: spam
*   **ad**: ads
*   **politics**: political content
*   **terrorism**: terrorist content
*   **abuse**: abuse
*   **porn**: pornographic content.
*   **flood**: excessive junk content
*   **contraband**: prohibited content
*   **meaningless**: meaningless content', example='normal'),
          scene?: string(name='Scene', description='The review scenario. The value is **antispam**.', example='antispam'),
          score?: string(name='Score', description='The score.', example='99.91'),
          suggestion?: string(name='Suggestion', description='The recommendation for review results. Valid values:

*   **block**
*   **review**
*   **pass**', example='pass'),
        }
      ](name='AudioResult', description='The results of audio review.'),
      imageResult?: [ 
        {
          label?: string(name='Label', description='The categories of the image review results. Multiple values are separated by commas (,). Valid values:

*   **porn**: pornographic content
*   **terrorism**: terrorist or politically sensitive content
*   **ad**: ad violation
*   **live**: undesirable scene
*   **logo**: logo
*   **normal**: normal content', example='normal'),
          result?: [ 
            {
              label?: string(name='Label', description='The category of the review result.

Valid values if scene is **porn**:

*   **porn**
*   **sexy**
*   **normal**

Valid values if scene is **terrorism**:

*   **normal**
*   **bloody**
*   **explosion**
*   **outfit**
*   **logo**
*   **weapon**
*   **politics**
*   **violence**
*   **crowd**
*   **parade**
*   **carcrash**
*   **flag**
*   **location**
*   **others**

Valid values if scene is **ad**:

*   **normal**: normal content
*   **ad**: ads
*   **politics**: political content
*   **porn**: pornographic content
*   **abuse**: verbal abuse
*   **terrorism**: terrorist content
*   **contraband**: prohibited content
*   **spam**: spam content
*   **npx**: illegal ad
*   **qrcode**: QR code
*   **programCode**: mini program code

Valid values if scene is **live**:

*   **normal**: normal content
*   **meaningless**: meaningless content, such as a black or white screen.
*   **PIP**: picture-in-picture
*   **smoking**: smoking
*   **drivelive**: live broadcasting in a running vehicle

Valid values if scene is **logo**:

*   **normal**: normal content
*   **TV**: controlled TV station logo
*   **trademark**: trademark', example='porn'),
              scene?: string(name='Scene', description='The review scenario. Valid values:

*   **porn**: pornographic content
*   **terrorism**: terrorist or politically sensitive content
*   **ad**: ad violation
*   **live**: undesirable scene
*   **logo**: logo', example='porn'),
              score?: string(name='Score', description='The score of the image of the category that is indicated by Label. Valid values: `[0, 100]`. The score is representative of the confidence.', example='0'),
              suggestion?: string(name='Suggestion', description='The recommendation for review results. Valid values:

*   **block**
*   **review**
*   **pass**', example='pass'),
            }
          ](name='Result', description='Details of image review results.'),
          suggestion?: string(name='Suggestion', description='The recommendation for review results. Valid values:

*   **block**
*   **review**
*   **pass**', example='pass'),
          type?: string(name='Type', description='The type of the image. Valid value: **cover**.', example='cover'),
          url?: string(name='Url', description='The URL of the image.', example='http://www.test.com/****.jpg'),
        }
      ](name='ImageResult', description='The results of image review.'),
      label?: string(name='Label', description='The category of the review result. Multiple values are separated by commas (,). Valid values:

*   **porn**: pornographic content
*   **terrorism**: terrorist or politically sensitive content
*   **ad**: ad violation
*   **live**: undesirable scene
*   **logo**: logo
*   **audio**: audio anti-spam
*   **normal**: normal content', example='normal'),
      suggestion?: string(name='Suggestion', description='The recommendation for review results. Valid values:

*   **block**: The content violates the regulations.
*   **review**: The content may violate the regulations.
*   **pass**: The content passes the review.', example='pass'),
      textResult?: [ 
        {
          content?: string(name='Content', description='The text content.', example='Test'),
          label?: string(name='Label', description='The category of the review result. Valid values:

*   **spam**: spam content
*   **ad**: ads
*   **abuse**: abuse
*   **flood**: excessive junk content
*   **contraband**: prohibited content
*   **meaningless**: meaningless content
*   **normal**: normal content', example='ad'),
          scene?: string(name='Scene', description='The review scenario. The value is **antispam**.', example='antispam'),
          score?: string(name='Score', description='The score of the image of the category that is indicated by Label. Valid values: `[0, 100]`. The score is representative of the confidence.', example='100'),
          suggestion?: string(name='Suggestion', description='The recommendation for review results. Valid values:

*   **block**
*   **review**
*   **pass**', example='pass'),
          type?: string(name='Type', description='The type of the text. The value is **title**.', example='title'),
        }
      ](name='TextResult', description='The text moderation results.'),
      videoResult?: {
        adResult?: {
          averageScore?: string(name='AverageScore', description='The average score of the review results.', example='100'),
          counterList?: [ 
            {
              count?: int32(name='Count', description='The number of video snapshots.', example='10'),
              label?: string(name='Label', description='The categories of the ad review results. Valid values:

*   **normal**: normal content
*   **ad**: other ads
*   **politics**: political content
*   **porn**: pornographic content
*   **abuse**: abuse
*   **terrorism**: terrorist content
*   **contraband**: prohibited content
*   **spam**: spam content
*   **npx**: illegal ad
*   **qrcode**: QR code
*   **programCode**: mini program code', example='ad'),
            }
          ](name='CounterList', description='The number of snapshots of each category in the review result.'),
          label?: string(name='Label', description='The categories of the ad review results. Valid values:

*   **normal**: normal content
*   **ad**: other ads
*   **politics**: political content
*   **porn**: pornographic content
*   **abuse**: abuse
*   **terrorism**: terrorist content
*   **contraband**: prohibited content
*   **spam**: spam content
*   **npx**: illegal ad
*   **qrcode**: QR code
*   **programCode**: mini program code', example='ad'),
          maxScore?: string(name='MaxScore', description='The highest review score.', example='100'),
          suggestion?: string(name='Suggestion', description='The recommendation for review results. Valid values:

*   **block**: The content violates the regulations.
*   **review**: The content may violate the regulations.
*   **pass**: The content passes the review.', example='block'),
          topList?: [ 
            {
              label?: string(name='Label', description='The categories of the ad review results. Valid values:

*   **normal**: normal content
*   **ad**: other ads
*   **politics**: political content
*   **porn**: pornographic content
*   **abuse**: abuse
*   **terrorism**: terrorist content
*   **contraband**: prohibited content
*   **spam**: spam content
*   **npx**: illegal ad
*   **qrcode**: QR code
*   **programCode**: mini program code', example='ad'),
              score?: string(name='Score', description='The score of the snapshot in the category that is indicated by Label.', example='100'),
              timestamp?: string(name='Timestamp', description='The timestamp of the snapshot in the video. Unit: milliseconds.', example='500'),
              url?: string(name='Url', description='The URL of the video snapshot.', example='http://temp-****bucket.oss-cn-shanghai.aliyuncs.com/aivideocensor/****.jpg'),
            }
          ](name='TopList', description='The information about the snapshot that has the highest score in the category.'),
        }(name='AdResult', description='The results of ad review.'),
        label?: string(name='Label', description='The category of the review result. Valid values:

*   **porn**: pornographic content
*   **terrorism**: terrorist or politically sensitive content
*   **ad**: ad violation
*   **live**: undesirable scene
*   **logo**: logo
*   **normal**', example='normal'),
        liveResult?: {
          averageScore?: string(name='AverageScore', description='The average score of the review results.', example='100'),
          counterList?: [ 
            {
              count?: int32(name='Count', description='The number of video snapshots.', example='0'),
              label?: string(name='Label', description='The category of the review result. Valid values:

*   **normal**: normal content
*   **meaningless**: meaningless content, such as a black or white screen.
*   **PIP**: picture-in-picture
*   **smoking**: smoking
*   **drivelive**: live broadcasting in a running vehicle', example='live'),
            }
          ](name='CounterList', description='The categories of the review results and the number of video snapshots in each category.'),
          label?: string(name='Label', description='The category of the review result. Valid values:

*   **normal**: normal content
*   **meaningless**: meaningless content, such as a black or white screen.
*   **PIP**: picture-in-picture
*   **smoking**: smoking
*   **drivelive**: live broadcasting in a running vehicle', example='live'),
          maxScore?: string(name='MaxScore', description='The highest review score.', example='100'),
          suggestion?: string(name='Suggestion', description='The recommendation for review results. Valid values:

*   **block**: The content violates the regulations.
*   **review**: The content may violate the regulations.
*   **pass**: The content passes the review.', example='block'),
          topList?: [ 
            {
              label?: string(name='Label', description='The category of the review result. Valid values:

*   **normal**: normal content
*   **meaningless**: meaningless content, such as a black or white screen.
*   **PIP**: picture-in-picture
*   **smoking**: smoking
*   **drivelive**: live broadcasting in a running vehicle', example='live'),
              score?: string(name='Score', description='The score of the snapshot in the category that is indicated by Label.', example='100'),
              timestamp?: string(name='Timestamp', description='The timestamp of the snapshot in the video. Unit: milliseconds.', example='500'),
              url?: string(name='Url', description='The URL of the video snapshot.', example='http://temp-****bucket.oss-cn-shanghai.aliyuncs.com/aivideocensor/****.jpg'),
            }
          ](name='TopList', description='The information about the snapshot that has the highest score in the category.'),
        }(name='LiveResult', description='The results of undesired content review.'),
        logoResult?: {
          averageScore?: string(name='AverageScore', description='The average score of the snapshots in the category indicated by Label.', example='100'),
          counterList?: [ 
            {
              count?: int32(name='Count', description='The number of video snapshots.', example='2'),
              label?: string(name='Label', description='The category of the review result. Valid values:

*   **normal**: normal content
*   **TV**: controlled TV station logo
*   **trademark**: trademark', example='logo'),
            }
          ](name='CounterList', description='The categories of the review results and the number of video snapshots in each category.'),
          label?: string(name='Label', description='The category of the review result. Valid values:

*   **normal**: normal content
*   **TV**: controlled TV station logo
*   **trademark**: trademark', example='logo'),
          maxScore?: string(name='MaxScore', description='The highest score of the snapshot of the category that is indicated by Label.', example='100'),
          suggestion?: string(name='Suggestion', description='The recommendation for review results. Valid values:

*   **block**: The content violates the regulations.
*   **review**: The content may violate the regulations.
*   **pass**: The content passes the review.', example='block'),
          topList?: [ 
            {
              label?: string(name='Label', description='The category of the review result. Valid values:

*   **normal**: normal content
*   **TV**: controlled TV station logo
*   **trademark**: trademark', example='logo'),
              score?: string(name='Score', description='The score of the snapshot in the category that is indicated by Label.', example='100'),
              timestamp?: string(name='Timestamp', description='The timestamp of the snapshot in the video. Unit: milliseconds.', example='5000'),
              url?: string(name='Url', description='The URL of the video snapshot.', example='http://temp-****bucket.oss-cn-shanghai.aliyuncs.com/aivideocensor/****.jpg'),
            }
          ](name='TopList', description='The information about the snapshot that has the highest score in the category.'),
        }(name='LogoResult', description='The results of logo review.'),
        pornResult?: {
          averageScore?: string(name='AverageScore', description='The average score of the snapshots of the category that is indicated by Label. Valid values: `[0, 100]`. The value is accurate to 10 decimal places. The score is representative of the confidence.', example='100'),
          counterList?: [ 
            {
              count?: int32(name='Count', description='The number of video snapshots.', example='0'),
              label?: string(name='Label', description='The results of pornographic content review. Valid values:

*   **porn**
*   **sexy**
*   **normal**', example='porn'),
            }
          ](name='CounterList', description='The number of snapshots of each category in the review result.'),
          label?: string(name='Label', description='The category of the review result. Valid values:

*   **porn**
*   **sexy**
*   **normal**', example='porn'),
          maxScore?: string(name='MaxScore', description='The highest score of the snapshot of the category that is indicated by Label. Valid values: `[0, 100]`. The value is accurate to 10 decimal places. The score is representative of the confidence.', example='100'),
          suggestion?: string(name='Suggestion', description='The recommendation for review results. Valid values:

*   **block**: The content violates the regulations.
*   **review**: The content may violate the regulations.
*   **pass**: The content passes the review.', example='pass'),
          topList?: [ 
            {
              label?: string(name='Label', description='The results of pornographic content review. Valid values:

*   **porn**
*   **sexy**
*   **normal**', example='porn'),
              score?: string(name='Score', description='The score of the snapshot in the category that is indicated by Label. Valid values: `[0, 100]`. The value is accurate to 10 decimal places. The score is representative of the confidence.', example='100'),
              timestamp?: string(name='Timestamp', description='The timestamp of the snapshot in the video. Unit: milliseconds.', example='3005'),
              url?: string(name='Url', description='The URL of the video snapshot.', example='http://temp-****bucket.oss-cn-shanghai.aliyuncs.com/aivideocensor/****.jpg'),
            }
          ](name='TopList', description='The information about the snapshot that has the highest score in the category.'),
        }(name='PornResult', description='The results of pornographic content review.'),
        suggestion?: string(name='Suggestion', description='The recommendation for video review results. Valid values:

*   **block**
*   **review**
*   **pass**', example='pass'),
        terrorismResult?: {
          averageScore?: string(name='AverageScore', description='The average score of the snapshots of the category that is indicated by Label. Valid values: `[0, 100]`. The value is accurate to 10 decimal places. The score is representative of the confidence.', example='100'),
          counterList?: [ 
            {
              count?: int32(name='Count', description='The number of video snapshots.', example='0'),
              label?: string(name='Label', description='The results of terrorist content review. Valid values:

*   **normal**
*   **bloody**
*   **explosion**
*   **outfit**
*   **logo**
*   **weapon**
*   **politics**
*   **violence**
*   **crowd**
*   **parade**
*   **carcrash**
*   **flag**
*   **location**
*   **others**', example='terrorism'),
            }
          ](name='CounterList', description='The categories of terrorist content review results and the number of video snapshots in each category.'),
          label?: string(name='Label', description='The category of the review result. Valid values:

*   **normal**
*   **bloody**
*   **explosion**
*   **outfit**
*   **logo**
*   **weapon**
*   **politics**
*   **violence**
*   **crowd**
*   **parade**
*   **carcrash**
*   **flag**
*   **location**
*   **others**', example='normal'),
          maxScore?: string(name='MaxScore', description='The highest score of the snapshot of the category that is indicated by Label. Valid values: `[0, 100]`. The value is accurate to 10 decimal places. The score is representative of the confidence.', example='100'),
          suggestion?: string(name='Suggestion', description='The recommendation for terrorist content review results. Valid values:

*   **block**
*   **review**
*   **pass**', example='pass'),
          topList?: [ 
            {
              label?: string(name='Label', description='The results of terrorist content review. Valid values:

*   **normal**
*   **bloody**
*   **explosion**
*   **outfit**
*   **logo**
*   **weapon**
*   **politics**
*   **violence**
*   **crowd**
*   **parade**
*   **carcrash**
*   **flag**
*   **location**
*   **others**', example='normal'),
              score?: string(name='Score', description='The score of the snapshot in the category that is indicated by Label. Valid values: `[0, 100]`. The value is accurate to 10 decimal places. The score is representative of the confidence.', example='100'),
              timestamp?: string(name='Timestamp', description='The timestamp of the snapshot in the video. Unit: milliseconds.', example='5'),
              url?: string(name='Url', description='The URL of the video snapshot.', example='http://ali*****.com/aivideocensor/yytysursrutyrxuq/****.jpg'),
            }
          ](name='TopList', description='The information about the snapshot that has the highest score in the category.'),
        }(name='TerrorismResult', description='The results of terrorist content review.'),
      }(name='VideoResult', description='The results of video review.'),
    }(name='Data', description='The job result.'),
    jobId?: string(name='JobId', description='The ID of the job.', example='bdbc266af6894*****943a70176d92e9'),
    mediaId?: string(name='MediaId', description='The ID of the video.', example='fe028d09441d*****d1afffb138cd7e'),
    message?: string(name='Message', description='The error message. This parameter is returned if the value of Status is fail.', example='OK'),
    status?: string(name='Status', description='The status of the job. Valid values:

*   **success**: The job is successful.
*   **fail**: The job failed.
*   **init**: The job is being initialized.
*   **Processing**: The job is in progress.', example='success'),
    type?: string(name='Type', description='The type of the job. The value is AIMediaAudit.', example='AIMediaAudit'),
  }(name='MediaAuditJob', description='The information about the intelligent review job.'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='EAA3E96A-02E2-41*****85-08E1D568ED3A'),
}

model GetAIMediaAuditJobResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: GetAIMediaAuditJobResponseBody(name='body'),
}

/**
 * @summary Queries the information about an intelligent review job. After the job is submitted, it is processed asynchronously. You can call this operation to query the job information in real time.
 *
 * @description ApsaraVideo VOD stores the snapshots of the intelligent review results free of charge for two weeks. After this period, the snapshots are automatically deleted.
 *
 * @param request GetAIMediaAuditJobRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return GetAIMediaAuditJobResponse
 */
async function getAIMediaAuditJobWithOptions(request: GetAIMediaAuditJobRequest, runtime: $RuntimeOptions): GetAIMediaAuditJobResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.jobId)) {
    query['JobId'] = request.jobId;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'GetAIMediaAuditJob',
    version = '2017-03-21',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Queries the information about an intelligent review job. After the job is submitted, it is processed asynchronously. You can call this operation to query the job information in real time.
 *
 * @description ApsaraVideo VOD stores the snapshots of the intelligent review results free of charge for two weeks. After this period, the snapshots are automatically deleted.
 *
 * @param request GetAIMediaAuditJobRequest
 * @return GetAIMediaAuditJobResponse
 */
async function getAIMediaAuditJob(request: GetAIMediaAuditJobRequest): GetAIMediaAuditJobResponse {
  var runtime = new $RuntimeOptions{};
  return getAIMediaAuditJobWithOptions(request, runtime);
}

model GetAITemplateRequest {
  templateId?: string(name='TemplateId', description='The ID of the AI template. You can use one of the following methods to obtain the ID:

*   Call the [AddAITemplate](https://help.aliyun.com/document_detail/102930.html) operation to add an AI template if no AI template exists. The value of TemplateId in the response is the ID of the AI template.
*   Call the [ListAITemplate](https://help.aliyun.com/document_detail/102936.html) operation if the template already exists. The value of TemplateId in the response is the ID of the AI template.

This parameter is required.', example='1706a0063dd733f6a823ef32e0a5****'),
}

model GetAITemplateResponseBody = {
  requestId?: string(name='RequestId', description='The ID of the request.', example='080DA371-8AC0-4CD4-4476-33E64282****'),
  templateInfo?: {
    creationTime?: string(name='CreationTime', description='The time when the AI template was created. The time follows the ISO 8601 standard in the *yyyy-MM-dd*T*HH:mm:ss*Z format. The time is displayed in UTC.', example='2020-07-08T06:50:45Z'),
    isDefault?: string(name='IsDefault', description='Indicates whether the template is the default AI template. Valid values:

*   **Default**
*   **NotDefault**', example='NotDefault'),
    modifyTime?: string(name='ModifyTime', description='The time when the AI template was modified. The time follows the ISO 8601 standard in the *yyyy-MM-dd*T*HH:mm:ss*Z format. The time is displayed in UTC.', example='2020-07-08T06:58:45Z'),
    source?: string(name='Source', description='The source of the AI template. Valid values:

*   **System**
*   **Custom**', example='Custom'),
    templateConfig?: string(name='TemplateConfig', description='The detailed configurations of the AI template. The value is a JSON string. For more information, see [AITemplateConfig](~~89863#title-vd3-499-o36~~).', example='{"AuditRange":["text-title","video"],"AuditContent":["screen"],"AuditItem":["terrorism","porn"],"AuditAutoBlock":"yes"}'),
    templateId?: string(name='TemplateId', description='The ID of the AI template.', example='1706a0063dd733f6a823ef32e0a5****'),
    templateName?: string(name='TemplateName', description='The name of the AI template.', example='DemoAITemplate'),
    templateType?: string(name='TemplateType', description='The type of the AI template. Valid values:

*   **AIMediaAudit**: automated review
*   **AIImage**: smart thumbnail', example='AIMediaAudit'),
  }(name='TemplateInfo', description='The information about the AI template.'),
}

model GetAITemplateResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: GetAITemplateResponseBody(name='body'),
}

/**
 * @summary Queries the details of an AI template.
 *
 * @description *   Regions that support this operation: **China (Beijing)**, **China (Shanghai)**, and **Singapore**.
 * *   Before you call this operation to query details of an AI template, you must obtain the ID of the AI template.
 *
 * @param request GetAITemplateRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return GetAITemplateResponse
 */
async function getAITemplateWithOptions(request: GetAITemplateRequest, runtime: $RuntimeOptions): GetAITemplateResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.templateId)) {
    query['TemplateId'] = request.templateId;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'GetAITemplate',
    version = '2017-03-21',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Queries the details of an AI template.
 *
 * @description *   Regions that support this operation: **China (Beijing)**, **China (Shanghai)**, and **Singapore**.
 * *   Before you call this operation to query details of an AI template, you must obtain the ID of the AI template.
 *
 * @param request GetAITemplateRequest
 * @return GetAITemplateResponse
 */
async function getAITemplate(request: GetAITemplateRequest): GetAITemplateResponse {
  var runtime = new $RuntimeOptions{};
  return getAITemplateWithOptions(request, runtime);
}

model GetAIVideoTagResultRequest {
  mediaId?: string(name='MediaId', description='The ID of the media file. You can use one of the following methods to obtain the ID:

*   Log on to the [ApsaraVideo VOD](https://vod.console.aliyun.com) console. In the left-side navigation pane, choose **Media Files** > **Audio/Video**. On the Video and Audio page, view the ID of the audio or video file. This method is applicable to files that are uploaded by using the ApsaraVideo VOD console.
*   Obtain the value of VideoId from the response to the [CreateUploadVideo](https://help.aliyun.com/document_detail/55407.html) operation that you call to upload media files.
*   Obtain the value of VideoId from the response to the [SearchMedia](https://help.aliyun.com/document_detail/86044.html) operation after you upload media files.

This parameter is required.', example='595d020bad37421f37433451720****'),
  ownerAccount?: string(name='OwnerAccount'),
  ownerId?: string(name='OwnerId'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: string(name='ResourceOwnerId'),
}

model GetAIVideoTagResultResponseBody = {
  requestId?: string(name='RequestId', description='The ID of the request.', example='8829B4DB-AFD9-4FF6-12965DBFFA14****'),
  videoTagResult?: {
    category?: [ 
      {
        tag?: string(name='Tag', description='The tag string.', example='Retouching'),
      }
    ](name='Category', description='The video categories.'),
    keyword?: [ 
      {
        tag?: string(name='Tag', description='The tag string.', example='Cushion'),
        times?: [ string ](name='Times', description='The points in time when the tags are displayed. Unit: milliseconds.'),
      }
    ](name='Keyword', description='The keyword tags.'),
    location?: [ 
      {
        tag?: string(name='Tag', description='The tag string.', example='Asia'),
        times?: [ string ](name='Times', description='The points in time when the tags are displayed. Unit: milliseconds.'),
      }
    ](name='Location', description='The location tags.'),
    person?: [ 
      {
        faceUrl?: string(name='FaceUrl', description='The URL of the profile photo.

> This parameter is returned only when a figure tag was used.', example='http://example.com/aivideotag/8829B4DB-AFD9-4F*****F6-12965DBFFA14/Index_****.jpg'),
        tag?: string(name='Tag', description='The tag string.', example='John'),
        times?: [ string ](name='Times', description='The points in time when the tags are displayed. Unit: milliseconds.'),
      }
    ](name='Person', description='The figure tags.'),
    time?: [ 
      {
        tag?: string(name='Tag', description='The tag string.', example='Milliseconds'),
        times?: [ string ](name='Times', description='The points in time when the tags are displayed. Unit: milliseconds.'),
      }
    ](name='Time', description='The time tags.'),
  }(name='VideoTagResult', description='The returned result.'),
}

model GetAIVideoTagResultResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: GetAIVideoTagResultResponseBody(name='body'),
}

/**
 * @summary Queries the results of smart tagging jobs.
 *
 * @description *   Regions that support this operation: **China (Beijing)**, **China (Shanghai)**, and **Singapore**.
 * *   You can obtain the smart tagging results by using the video ID.
 *
 * @param request GetAIVideoTagResultRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return GetAIVideoTagResultResponse
 */
async function getAIVideoTagResultWithOptions(request: GetAIVideoTagResultRequest, runtime: $RuntimeOptions): GetAIVideoTagResultResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.mediaId)) {
    query['MediaId'] = request.mediaId;
  }
  if (!$isNull(request.ownerAccount)) {
    query['OwnerAccount'] = request.ownerAccount;
  }
  if (!$isNull(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!$isNull(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!$isNull(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'GetAIVideoTagResult',
    version = '2017-03-21',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Queries the results of smart tagging jobs.
 *
 * @description *   Regions that support this operation: **China (Beijing)**, **China (Shanghai)**, and **Singapore**.
 * *   You can obtain the smart tagging results by using the video ID.
 *
 * @param request GetAIVideoTagResultRequest
 * @return GetAIVideoTagResultResponse
 */
async function getAIVideoTagResult(request: GetAIVideoTagResultRequest): GetAIVideoTagResultResponse {
  var runtime = new $RuntimeOptions{};
  return getAIVideoTagResultWithOptions(request, runtime);
}

model GetAppInfosRequest {
  appIds?: string(name='AppIds', description='The IDs of applications. You can obtain application IDs from the response to the [CreateAppInfo](https://help.aliyun.com/document_detail/113266.html) or [ListAppInfo](https://help.aliyun.com/document_detail/114000.html) operation.

*   You can specify a maximum of 10 application IDs.
*   Separate application IDs with commas (,).

This parameter is required.', example='app-****'),
}

model GetAppInfosResponseBody = {
  appInfoList?: [ 
    {
      appId?: string(name='AppId', description='The ID of the application.', example='app-****'),
      appName?: string(name='AppName', description='The name of the application.', example='test'),
      creationTime?: string(name='CreationTime', description='The time when the application was created. The time is in the *yyyy-MM-dd*T*HH:mm:ss*Z format. The time is displayed in UTC.', example='2019-03-01T08:00:00Z'),
      description?: string(name='Description', description='The description of the application.', example='my first app.'),
      modificationTime?: string(name='ModificationTime', description='The last time when the application was modified. The time is in the *yyyy-MM-dd*T*HH:mm:ss*Z format. The time is displayed in UTC.', example='2019-03-01T09:00:00Z'),
      resourceGroupId?: string(name='ResourceGroupId', description='The resource group ID.', example='rg-aekzko7fsuj****'),
      status?: string(name='Status', description='The status of the application. Valid values:

*   **Normal**
*   **Disable**', example='Normal'),
      type?: string(name='Type', description='The type of the application. Valid values:

*   **System**
*   **Custom**', example='System'),
    }
  ](name='AppInfoList', description='The details of applications.'),
  code?: string(name='Code', description='The HTTP status code that is returned.', example='200'),
  nonExistAppIds?: [ string ](name='NonExistAppIds', description='The IDs of applications that do not exist.'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='25818875-5F78-4A13-4DC4-D7393642****'),
}

model GetAppInfosResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: GetAppInfosResponseBody(name='body'),
}

/**
 * @summary Queries the information about one or more applications based on application IDs.
 *
 * @description You can specify multiple accelerated domain names in a request.
 *
 * @param request GetAppInfosRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return GetAppInfosResponse
 */
async function getAppInfosWithOptions(request: GetAppInfosRequest, runtime: $RuntimeOptions): GetAppInfosResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.appIds)) {
    query['AppIds'] = request.appIds;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'GetAppInfos',
    version = '2017-03-21',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Queries the information about one or more applications based on application IDs.
 *
 * @description You can specify multiple accelerated domain names in a request.
 *
 * @param request GetAppInfosRequest
 * @return GetAppInfosResponse
 */
async function getAppInfos(request: GetAppInfosRequest): GetAppInfosResponse {
  var runtime = new $RuntimeOptions{};
  return getAppInfosWithOptions(request, runtime);
}

model GetAttachedMediaInfoRequest {
  authTimeout?: long(name='AuthTimeout', description='The validity period of the URL. Unit: seconds.

*   If you set the OutputType parameter to **cdn**:

    *   The URL of the auxiliary media asset has a validity period only if URL signing is enabled. Otherwise, the URL of the auxiliary media asset is permanently valid.
    *   Minimum value: **1**.
    *   Maximum value: unlimited.
    *   Default value: If you do not set this parameter, the default validity period that is specified in URL signing is used.

*   If you set the OutputType parameter to **oss**:

    *   The URL of the auxiliary media asset has a validity period only if the permissions on the Object Storage Service (OSS) bucket are private. Otherwise, the URL of the auxiliary media asset is permanently valid.
    *   Minimum value: **1**.
    *   The maximum value for a media asset stored in the VOD bucket is **2592000** (30 days) and the maximum value for a media asset stored in an OSS bucket is **129600** (36 hours). The maximum value is limited to reduce security risks of the origin.
    *   Default value: If you do not set this parameter, the default value **3600** is used.', example='3600'),
  mediaIds?: string(name='MediaIds', description='The ID of the auxiliary media asset.

*   Separate multiple IDs with commas (,). You can specify up to 20 IDs.
*   You can obtain the ID from the response to the [CreateUploadAttachedMedia](~~CreateUploadAttachedMedia~~) operation that you call to obtain the upload URL and credential.

This parameter is required.', example='eb1861d2c9a842340e989dd56****,0222e203cf80f9c22870a4d2c****'),
  outputType?: string(name='OutputType', description='The type of the media asset URL. Valid values:

*   **oss**
*   **cdn** (default)', example='oss'),
}

model GetAttachedMediaInfoResponseBody = {
  attachedMediaList?: [ 
    {
      appId?: string(name='AppId', description='The ID of the application.', example='app-*****'),
      categories?: [ 
        {
          cateId?: long(name='CateId', description='The ID of the category.', example='1000224338'),
          cateName?: string(name='CateName', description='The name of the category.', example='category test'),
          level?: long(name='Level', description='The level of the category.', example='0'),
          parentId?: long(name='ParentId', description='The ID of the parent category.', example='1000224336'),
        }
      ](name='Categories', description='The categories.'),
      creationTime?: string(name='CreationTime', description='The time when the auxiliary media asset was created. The time follows the ISO 8601 standard in the *yyyy-MM-dd*T*HH:mm:ss*Z format. The time is displayed in UTC.', example='2019-01-01T10:00:00Z'),
      description?: string(name='Description', description='The description of the auxiliary media asset.

>  This parameter is returned only when a description is specified for the auxiliary media asset.', example='description test'),
      mediaId?: string(name='MediaId', description='The ID of the auxiliary media asset.', example='0222e203cf80f9c22870a4d2c****'),
      modificationTime?: string(name='ModificationTime', description='The time when the auxiliary media asset was last updated. The time follows the ISO 8601 standard in the *yyyy-MM-dd*T*HH:mm:ss*Z format. The time is displayed in UTC.', example='2020-05-31T11:42:20Z'),
      status?: string(name='Status', description='The status of the auxiliary media asset. Valid values:

*   **Uploading**
*   **Normal**
*   **UploadFail**', example='Normal'),
      storageLocation?: string(name='StorageLocation', description='The storage address of the auxiliary media asset.', example='outin-bfefbb9*****c7426.oss-cn-shanghai.aliyuncs.com'),
      tags?: string(name='Tags', description='The tags of the auxiliary media asset.

>  This parameter is returned only when tags are specified for the auxiliary media asset.', example='tag1,tag2'),
      title?: string(name='Title', description='The title of the auxiliary media asset.', example='subtitle test'),
      type?: string(name='Type', description='The type of the auxiliary media asset.

*   **watermark**
*   **subtitle**
*   **material**', example='subtitle'),
      URL?: string(name='URL', description='The URL of the auxiliary media asset.

>  If a CDN domain name is specified, a CDN URL is returned. Otherwise, an OSS URL is returned.', example='https://al*****.cn/subtitle/9843C2*****4E186F19B6.vtt?auth_key=159099f60e0b7fd59****'),
    }
  ](name='AttachedMediaList', description='The information about the media assets.'),
  nonExistMediaIds?: [ string ](name='NonExistMediaIds', description='The IDs of the auxiliary media assets that do not exist.'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='221BCB57-B217-42BF-619BD13378F9****'),
}

model GetAttachedMediaInfoResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: GetAttachedMediaInfoResponseBody(name='body'),
}

/**
 * @summary Queries the URL and basic information about one or more auxiliary media assets such as watermark images, subtitle files, and materials based on IDs.
 *
 * @description You can query information about up to 20 auxiliary media assets in a request.
 *
 * @param request GetAttachedMediaInfoRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return GetAttachedMediaInfoResponse
 */
async function getAttachedMediaInfoWithOptions(request: GetAttachedMediaInfoRequest, runtime: $RuntimeOptions): GetAttachedMediaInfoResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.authTimeout)) {
    query['AuthTimeout'] = request.authTimeout;
  }
  if (!$isNull(request.mediaIds)) {
    query['MediaIds'] = request.mediaIds;
  }
  if (!$isNull(request.outputType)) {
    query['OutputType'] = request.outputType;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'GetAttachedMediaInfo',
    version = '2017-03-21',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Queries the URL and basic information about one or more auxiliary media assets such as watermark images, subtitle files, and materials based on IDs.
 *
 * @description You can query information about up to 20 auxiliary media assets in a request.
 *
 * @param request GetAttachedMediaInfoRequest
 * @return GetAttachedMediaInfoResponse
 */
async function getAttachedMediaInfo(request: GetAttachedMediaInfoRequest): GetAttachedMediaInfoResponse {
  var runtime = new $RuntimeOptions{};
  return getAttachedMediaInfoWithOptions(request, runtime);
}

model GetAuditHistoryRequest {
  pageNo?: long(name='PageNo', description='The number of the page to return. Default value: **1**.', example='1'),
  pageSize?: long(name='PageSize', description='The number of entries to return on each page. Default value: **10**. Maximum value: **100**.', example='10'),
  sortBy?: string(name='SortBy', description='The sorting rule of the results. Valid values:
*   **CreationTime:Desc**: sorts the results based on the creation time in descending order. This is the default value.
*   **CreationTime:Asc**: sorts the results based on the creation time in ascending order.', example='CreationTime:Desc'),
  videoId?: string(name='VideoId', description='The ID of the video.

This parameter is required.', example='93ab850b4f6f44*****6e91d24d81d4'),
}

model GetAuditHistoryResponseBody = {
  histories?: [ 
    {
      auditor?: string(name='Auditor', description='The reviewer.', example='auditor'),
      comment?: string(name='Comment', description='The review comments, which are provided by the reviewer.', example='Contains nudity'),
      creationTime?: string(name='CreationTime', description='The time when the review record was created. The time follows the ISO 8601 standard in the *yyyy-MM-dd*T*HH:mm:ss*Z format. The time is displayed in UTC.', example='2017-01-11T12:00:00Z'),
      reason?: string(name='Reason', description='The reason why the video failed the review. If the video failed the review, specify the reason.', example='Pornographic video'),
      status?: string(name='Status', description='The manual review result. Valid values:
- **Normal**: The video can be played.
- **Blocked**: The video is blocked.', example='Blocked'),
    }
  ](name='Histories', description='The review records.'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='04F0F334-1335-43*****D7-6C044FE73368'),
  status?: string(name='Status', description='The manual review result. Valid values:
- **Normal**: The video can be played.
- **Blocked**: The video is blocked.', example='Normal'),
  total?: long(name='Total', description='The total number of review records.', example='2'),
}

model GetAuditHistoryResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: GetAuditHistoryResponseBody(name='body'),
}

/**
 * @summary Queries the manual review history.
 *
 * @param request GetAuditHistoryRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return GetAuditHistoryResponse
 */
async function getAuditHistoryWithOptions(request: GetAuditHistoryRequest, runtime: $RuntimeOptions): GetAuditHistoryResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.pageNo)) {
    query['PageNo'] = request.pageNo;
  }
  if (!$isNull(request.pageSize)) {
    query['PageSize'] = request.pageSize;
  }
  if (!$isNull(request.sortBy)) {
    query['SortBy'] = request.sortBy;
  }
  if (!$isNull(request.videoId)) {
    query['VideoId'] = request.videoId;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'GetAuditHistory',
    version = '2017-03-21',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Queries the manual review history.
 *
 * @param request GetAuditHistoryRequest
 * @return GetAuditHistoryResponse
 */
async function getAuditHistory(request: GetAuditHistoryRequest): GetAuditHistoryResponse {
  var runtime = new $RuntimeOptions{};
  return getAuditHistoryWithOptions(request, runtime);
}

model GetCategoriesRequest {
  cateId?: long(name='CateId', description='The ID of the category. If you specify this parameter, the system queries the category based on the ID. You can specify only one category ID. You can use one of the following methods to obtain the ID:

*   Log on to the [ApsaraVideo VOD console](https://vod.console.aliyun.com). Choose **Configuration Management** > **Media Management** > **Categories**. On the Audio and Video / Image Category or Short Video Material Category tab, view the category ID.
*   Obtain the category ID from the response to the [AddCategory](~~AddCategory~~) operation.', example='49339****'),
  pageNo?: long(name='PageNo', description='The number of the page where the subcategories to be returned are listed. Default value: **1**.', example='1'),
  pageSize?: long(name='PageSize', description='The number of entries to return on each page of the subcategory list. Default value: **10**. Maximum value: **100**.', example='10'),
  sortBy?: string(name='SortBy', description='The sorting method of the results. Valid values:

*   **CreationTime:Desc** (default): The results are sorted in reverse chronological order based on the creation time.
*   **CreationTime:Asc**: The results are sorted in chronological order based on the creation time.', example='CreationTime:Desc'),
  type?: string(name='Type', description='The type of the category. If you specify this parameter, the system queries the category based on the type. Valid values:

*   **default** (default): audio, video, and image files
*   **material**: short video materials', example='default'),
}

model GetCategoriesResponseBody = {
  category?: {
    cateId?: long(name='CateId', description='The ID of the category.', example='100'),
    cateName?: string(name='CateName', description='The name of the category.', example='film'),
    level?: long(name='Level', description='The level of the category. Valid values:

*   **0**: level 1 category
*   **1**: level 2 category
*   **2**: level 3 category', example='0'),
    parentId?: long(name='ParentId', description='The ID of the parent category.', example='100012****'),
    type?: string(name='Type', description='The type of the category. Valid values:

*   **default**: audio, video, and image files
*   **material**: short video materials', example='default'),
  }(name='Category', description='The information about the category.'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='25818875-5F78-4AF6-D7393642CA58****'),
  subCategories?: {
    category?: [ 
    {
      cateId?: long(name='CateId', description='The ID of the category.', example='100'),
      cateName?: string(name='CateName', description='The name of the category.', example='film'),
      level?: long(name='Level', description='The level of the category. Valid values:

*   **0**: level 1 category
*   **1**: level 2 category
*   **2**: level 3 category', example='1'),
      parentId?: long(name='ParentId', description='The ID of the parent category.', example='10020****'),
      subTotal?: long(name='SubTotal', description='The total number of subcategories.', example='1'),
      type?: string(name='Type', description='The type of the subcategory. Valid values:

*   **default**: audio, video, and image files
*   **material**: short video materials', example='default'),
    }
  ](name='Category')
  }(name='SubCategories', description='The details of the subcategory.'),
  subTotal?: long(name='SubTotal', description='The total number of subcategories.', example='3795'),
}

model GetCategoriesResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: GetCategoriesResponseBody(name='body'),
}

/**
 * @summary Queries the information about a specific category and its subcategories based on the ID or type of the category.
 *
 * @param request GetCategoriesRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return GetCategoriesResponse
 */
async function getCategoriesWithOptions(request: GetCategoriesRequest, runtime: $RuntimeOptions): GetCategoriesResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.cateId)) {
    query['CateId'] = request.cateId;
  }
  if (!$isNull(request.pageNo)) {
    query['PageNo'] = request.pageNo;
  }
  if (!$isNull(request.pageSize)) {
    query['PageSize'] = request.pageSize;
  }
  if (!$isNull(request.sortBy)) {
    query['SortBy'] = request.sortBy;
  }
  if (!$isNull(request.type)) {
    query['Type'] = request.type;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'GetCategories',
    version = '2017-03-21',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Queries the information about a specific category and its subcategories based on the ID or type of the category.
 *
 * @param request GetCategoriesRequest
 * @return GetCategoriesResponse
 */
async function getCategories(request: GetCategoriesRequest): GetCategoriesResponse {
  var runtime = new $RuntimeOptions{};
  return getCategoriesWithOptions(request, runtime);
}

model GetDailyPlayRegionStatisRequest {
  date?: string(name='Date', description='This parameter is required.', example='2025-03-20'),
  mediaRegion?: string(name='MediaRegion', description='This parameter is required.', example='cn-beijing'),
}

model GetDailyPlayRegionStatisResponseBody = {
  dailyPlayRegionStatisList?: [ 
    {
      date?: string(name='Date', example='2025-03-20'),
      fileUrl?: string(name='FileUrl', example='https://outin-e70266d4ed*******0163e1403e7.oss-cn-shanghai.aliyuncs.com/dataexport/play/cn_hangzhou_20250320_video_traffic.csv?*******'),
    }
  ](name='DailyPlayRegionStatisList'),
  emptyDates?: [ string ](name='EmptyDates'),
  failDates?: [ string ](name='FailDates'),
  requestId?: string(name='RequestId', example='67720502-CDDB-3F1C-8A91-12258*******'),
}

model GetDailyPlayRegionStatisResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: GetDailyPlayRegionStatisResponseBody(name='body'),
}

/**
 * @summary 支持区域化媒资ID级别播放数据查询
 *
 * @param request GetDailyPlayRegionStatisRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return GetDailyPlayRegionStatisResponse
 */
async function getDailyPlayRegionStatisWithOptions(request: GetDailyPlayRegionStatisRequest, runtime: $RuntimeOptions): GetDailyPlayRegionStatisResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.date)) {
    query['Date'] = request.date;
  }
  if (!$isNull(request.mediaRegion)) {
    query['MediaRegion'] = request.mediaRegion;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'GetDailyPlayRegionStatis',
    version = '2017-03-21',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 支持区域化媒资ID级别播放数据查询
 *
 * @param request GetDailyPlayRegionStatisRequest
 * @return GetDailyPlayRegionStatisResponse
 */
async function getDailyPlayRegionStatis(request: GetDailyPlayRegionStatisRequest): GetDailyPlayRegionStatisResponse {
  var runtime = new $RuntimeOptions{};
  return getDailyPlayRegionStatisWithOptions(request, runtime);
}

model GetDefaultAITemplateRequest {
  templateType?: string(name='TemplateType', description='The type of the AI template. Set the value to **AIMediaAudit**, which specifies the automated review.

This parameter is required.', example='AIMediaAudit'),
}

model GetDefaultAITemplateResponseBody = {
  requestId?: string(name='RequestId', description='The ID of the request.', example='A017F1DE-3DC3-4441-6755-37E81113****'),
  templateInfo?: {
    creationTime?: string(name='CreationTime', description='The time when the AI template was created. The time follows the ISO 8601 standard in the *yyyy-MM-dd*T*HH:mm:ss*Z format. The time is displayed in UTC.', example='2020-07-08T06:50:45Z'),
    isDefault?: string(name='IsDefault', description='Indicates whether the template is the default AI template. Valid values:

*   **Default**
*   **NotDefault**', example='Default'),
    modifyTime?: string(name='ModifyTime', description='The time when the AI template was modified. The time follows the ISO 8601 standard in the *yyyy-MM-dd*T*HH:mm:ss*Z format. The time is displayed in UTC.', example='2020-07-08T06:58:45Z'),
    source?: string(name='Source', description='The source of the AI template. Valid values:

*   **System**
*   **Custom**', example='Custom'),
    templateConfig?: string(name='TemplateConfig', description='The detailed configurations of the AI template. The value is a JSON string. For more information, see [AITemplateConfig](~~89863#title-vd3-499-o36~~).', example='{"AuditRange":["text-title","video"],"AuditContent":["screen"],"AuditItem":["terrorism","porn"],"AuditAutoBlock":"yes"}'),
    templateId?: string(name='TemplateId', description='The ID of the AI template.', example='1706a0063dd733f6a823ef32e0a5****'),
    templateName?: string(name='TemplateName', description='The name of the AI template.', example='DemoAITemplate'),
    templateType?: string(name='TemplateType', description='The type of the AI template. The value is **AIMediaAudit**, which indicates automated review.', example='AIMediaAudit'),
  }(name='TemplateInfo', description='The information about the AI template.'),
}

model GetDefaultAITemplateResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: GetDefaultAITemplateResponseBody(name='body'),
}

/**
 * @summary Queries information about the default AI template.
 *
 * @description *   Regions that support this operation: **China (Beijing)**, **China (Shanghai)**, and **Singapore**.
 * *   You can query information only about the default AI template for automated review.
 *
 * @param request GetDefaultAITemplateRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return GetDefaultAITemplateResponse
 */
async function getDefaultAITemplateWithOptions(request: GetDefaultAITemplateRequest, runtime: $RuntimeOptions): GetDefaultAITemplateResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.templateType)) {
    query['TemplateType'] = request.templateType;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'GetDefaultAITemplate',
    version = '2017-03-21',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Queries information about the default AI template.
 *
 * @description *   Regions that support this operation: **China (Beijing)**, **China (Shanghai)**, and **Singapore**.
 * *   You can query information only about the default AI template for automated review.
 *
 * @param request GetDefaultAITemplateRequest
 * @return GetDefaultAITemplateResponse
 */
async function getDefaultAITemplate(request: GetDefaultAITemplateRequest): GetDefaultAITemplateResponse {
  var runtime = new $RuntimeOptions{};
  return getDefaultAITemplateWithOptions(request, runtime);
}

model GetDigitalWatermarkExtractResultRequest {
  extractType?: string(name='ExtractType', description='The type of the watermark. Valid values:

*   **TraceMark**: user-tracing watermark
*   **CopyrightMark**: copyright watermark

This parameter is required.', example='TraceMark'),
  jobId?: string(name='JobId', description='The ID of the watermark extraction job.

*   You can obtain the ID from the response to the [SubmitDigitalWatermarkExtractJob](~~SubmitDigitalWatermarkExtractJob~~) operation.
*   If you specify this parameter, the result of the specified watermark extraction job is returned. If you leave this parameter empty, the results of all watermark extraction jobs submitted for the video are returned.', example='2bf4390af9e5491c09cc720ad****'),
  mediaId?: string(name='MediaId', description='The ID of the video from which you want to query the watermark content. You can specify only one ID. You can use one of the following methods to obtain the ID:

*   Log on to the [ApsaraVideo VOD console](https://vod.console.aliyun.com). In the left-side navigation pane, choose **Media Files** > **Audio/Video** to view the video ID.
*   Obtain the VideoId from the response to the [SearchMedia](~~SearchMedia~~) operation.

This parameter is required.', example='93ab850b4f6f54b6e91d24d81d4****'),
  ownerAccount?: string(name='OwnerAccount'),
  ownerId?: string(name='OwnerId'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: string(name='ResourceOwnerId'),
}

model GetDigitalWatermarkExtractResultResponseBody = {
  aiExtractResultList?: [ 
    {
      createTime?: string(name='CreateTime', description='The time when the watermark extraction job was created.', example='2023-09-16T02:49:04Z'),
      errorMessage?: string(name='ErrorMessage', description='The error message.', example='successful'),
      jobId?: string(name='JobId', description='The ID of the watermark extraction job.', example='3af004763bcf459698860f4ede20****'),
      modifyTime?: string(name='ModifyTime', description='The time when the watermark extraction job was last updated.', example='2023-09-17T06:20:45Z'),
      status?: string(name='Status', description='The status of the watermark extraction job. Valid values:

*   **Success**
*   **Failed**
*   **Processing**', example='Success'),
      waterMarkText?: string(name='WaterMarkText', description='The extracted watermark content.', example='test mark'),
    }
  ](name='AiExtractResultList', description='The details of the watermark extraction job.'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='42E0554B-80F4-4921-****-ACFB22CAAAD0'),
}

model GetDigitalWatermarkExtractResultResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: GetDigitalWatermarkExtractResultResponseBody(name='body'),
}

/**
 * @summary Queries the results of a digital watermark extraction job. You can call this operation to obtain information such as the job status and the content of the copyright or user-tracing watermark.
 *
 * @description *   This operation is supported only in the China (Shanghai) and China (Beijing) regions.
 * *   You can call this operation to query the watermark content after you call the [SubmitDigitalWatermarkExtractJob](~~SubmitDigitalWatermarkExtractJob~~) operation to extract the copyright or user-tracing watermark in a video.
 * *   You can query watermark content extracted only from watermark extraction jobs that are submitted in the last 2 years.
 *
 * @param request GetDigitalWatermarkExtractResultRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return GetDigitalWatermarkExtractResultResponse
 */
async function getDigitalWatermarkExtractResultWithOptions(request: GetDigitalWatermarkExtractResultRequest, runtime: $RuntimeOptions): GetDigitalWatermarkExtractResultResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.extractType)) {
    query['ExtractType'] = request.extractType;
  }
  if (!$isNull(request.jobId)) {
    query['JobId'] = request.jobId;
  }
  if (!$isNull(request.mediaId)) {
    query['MediaId'] = request.mediaId;
  }
  if (!$isNull(request.ownerAccount)) {
    query['OwnerAccount'] = request.ownerAccount;
  }
  if (!$isNull(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!$isNull(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!$isNull(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'GetDigitalWatermarkExtractResult',
    version = '2017-03-21',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Queries the results of a digital watermark extraction job. You can call this operation to obtain information such as the job status and the content of the copyright or user-tracing watermark.
 *
 * @description *   This operation is supported only in the China (Shanghai) and China (Beijing) regions.
 * *   You can call this operation to query the watermark content after you call the [SubmitDigitalWatermarkExtractJob](~~SubmitDigitalWatermarkExtractJob~~) operation to extract the copyright or user-tracing watermark in a video.
 * *   You can query watermark content extracted only from watermark extraction jobs that are submitted in the last 2 years.
 *
 * @param request GetDigitalWatermarkExtractResultRequest
 * @return GetDigitalWatermarkExtractResultResponse
 */
async function getDigitalWatermarkExtractResult(request: GetDigitalWatermarkExtractResultRequest): GetDigitalWatermarkExtractResultResponse {
  var runtime = new $RuntimeOptions{};
  return getDigitalWatermarkExtractResultWithOptions(request, runtime);
}

model GetEditingProjectRequest {
  ownerAccount?: string(name='OwnerAccount'),
  ownerId?: string(name='OwnerId'),
  projectId?: string(name='ProjectId', description='The ID of the online editing project.

This parameter is required.', example='fb2101bf24b27*****54cb318787dc'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: string(name='ResourceOwnerId'),
}

model GetEditingProjectResponseBody = {
  project?: {
    coverURL?: string(name='CoverURL', description='The thumbnail URL of the online editing project.', example='https://****.com/6AB4D0E1E1C74468883516C2349****.png'),
    creationTime?: string(name='CreationTime', description='The time when the online editing project was created. The time follows the ISO 8601 standard in the *yyyy-MM-dd*T*HH:mm:ss*Z format. The time is displayed in UTC.', example='2017-10-23T13:33:40Z'),
    description?: string(name='Description', description='The description of the online editing project.', example='testdescription'),
    modifiedTime?: string(name='ModifiedTime', description='The last time when the online editing project was modified. The time follows the ISO 8601 standard in the *yyyy-MM-dd*T*HH:mm:ss*Z format. The time is displayed in UTC.', example='2017-10-23T14:27:26Z'),
    projectId?: string(name='ProjectId', description='The ID of the online editing project.', example='fb2101bf24b27*****54cb318787dc'),
    regionId?: string(name='RegionId', description='The region where the online editing project was created.', example='cn-shanghai'),
    status?: string(name='Status', description='The status of the online editing project. Separate multiple states with commas (,). By default, all online editing projects were queried. Valid values:

*   **Normal**: indicates that the online editing project is in draft.
*   **Producing**: indicates that the video is being produced.
*   **Produced**: indicates that the video was produced.
*   **ProduceFailed**: indicates that the video failed to be produced.', example='Normal'),
    storageLocation?: string(name='StorageLocation', description='The path of the Object Storage Service (OSS) bucket where the online editing project is stored.

> To view the path of the OSS bucket, log on to the [ApsaraVideo VOD console](https://vod.console.aliyun.com/?spm=a2c4g.11186623.2.15.6948257eaZ4m54#/vod/settings/censored), and choose **Configuration Management** > **Media Management** > **Storage**. On the Storage page, you can view the path of the OSS bucket.', example='location_s'),
    timeline?: string(name='Timeline', description='The timeline of the online editing project.', example='{\\\\"TimelineIn\\\\":0,\\\\"TimelineOut\\\\":9.42}'),
    title?: string(name='Title', description='The title of the online editing project.', example='video_1508736815000'),
  }(name='Project', description='The information about the online editing project.'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='63E8B7C7-4812-46*****AD-0FA56029AC86'),
}

model GetEditingProjectResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: GetEditingProjectResponseBody(name='body'),
}

/**
 * @summary 获取剪辑工程
 *
 * @param request GetEditingProjectRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return GetEditingProjectResponse
 */
async function getEditingProjectWithOptions(request: GetEditingProjectRequest, runtime: $RuntimeOptions): GetEditingProjectResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.ownerAccount)) {
    query['OwnerAccount'] = request.ownerAccount;
  }
  if (!$isNull(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!$isNull(request.projectId)) {
    query['ProjectId'] = request.projectId;
  }
  if (!$isNull(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!$isNull(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'GetEditingProject',
    version = '2017-03-21',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 获取剪辑工程
 *
 * @param request GetEditingProjectRequest
 * @return GetEditingProjectResponse
 */
async function getEditingProject(request: GetEditingProjectRequest): GetEditingProjectResponse {
  var runtime = new $RuntimeOptions{};
  return getEditingProjectWithOptions(request, runtime);
}

model GetEditingProjectMaterialsRequest {
  materialType?: string(name='MaterialType', description='The type of the material. Valid values:

*   **video**
*   **audio**
*   **image**', example='video'),
  ownerAccount?: string(name='OwnerAccount'),
  ownerId?: string(name='OwnerId'),
  projectId?: string(name='ProjectId', description='The ID of the online editing project. You can use one of the following methods to obtain the ID of the online editing project:

*   Log on to the [ApsaraVideo VOD console](https://vod.console.aliyun.com). In the left-side navigation pane, choose **Production Center** > **Video Editing** to obtain the ID of the specified online editing project.
*   Call the **AddEditingProject** operation. The value of the response parameter ProjectId is the ID of the specified online editing project.

This parameter is required.', example='1982361011093374****'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: string(name='ResourceOwnerId'),
  type?: string(name='Type', description='The type of the material. Valid values:

*   **video**
*   **audio**', example='video'),
}

model GetEditingProjectMaterialsResponseBody = {
  materialList?: {
    material?: [ 
    {
      cateId?: int32(name='CateId', description='The category ID of the material.', example='100005****'),
      cateName?: string(name='CateName', description='The category name of the material.', example='test1'),
      coverURL?: string(name='CoverURL', description='The thumbnail URL of the material.'),
      creationTime?: string(name='CreationTime', description='The time when the material was created. The time follows the ISO 8601 standard in the *yyyy-MM-dd*T*HH:mm:ss*Z format. The time is displayed in UTC.', example='2017-10-19 10:48:17'),
      description?: string(name='Description', description='The description of the material.', example='test2'),
      duration?: float(name='Duration', description='The duration of the material. The value is rounded to four decimal places. Unit: seconds.', example='15.16'),
      materialId?: string(name='MaterialId', description='The ID of the material.', example='85befc4118b84c6723e53b80b1****'),
      materialType?: string(name='MaterialType', description='The type of the material. Valid values:

*   **video**
*   **audio**
*   **image**', example='video'),
      modifiedTime?: string(name='ModifiedTime', description='The time when the material was last updated. The time follows the ISO 8601 standard in the *yyyy-MM-dd*T*HH:mm:ss*Z format. The time is displayed in UTC.', example='2017-10-19 10:48:17'),
      size?: long(name='Size', description='The size of the mezzanine file. Unit: byte.', example='1682694'),
      snapshots?: {
        snapshot?: [ string ](name='Snapshot')
      }(name='Snapshots', description='The URLs of material snapshots. The value is an array.'),
      source?: string(name='Source', description='The source of the sprite.', example='xxx'),
      spriteConfig?: string(name='SpriteConfig', description='The configuration of the sprite.', example='xxx'),
      sprites?: {
        sprite?: [ string ](name='Sprite')
      }(name='Sprites', description='The URLs of material sprites. The value is an array.'),
      status?: string(name='Status', description='The status of the material. Valid values:

*   **Normal**: The material is in draft.
*   **Producing**: The material is being produced.
*   **Produced**: The material was produced.
*   **ProduceFailed**: The material failed to be produced.', example='Normal'),
      tags?: string(name='Tags', description='The tag of the material. Multiple tags are separated by commas (,).', example='editing test'),
      title?: string(name='Title', description='The title of the material.', example='test'),
    }
  ](name='Material')
  }(name='MaterialList', description='The materials.'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='746FFA07-8BBB-46B1-3E94E3B2915E****'),
}

model GetEditingProjectMaterialsResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: GetEditingProjectMaterialsResponseBody(name='body'),
}

/**
 * @summary Queries materials to be edited for an online editing project.
 *
 * @description During editing, you can add materials to the timeline, but some of them may not be used.
 *
 * @param request GetEditingProjectMaterialsRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return GetEditingProjectMaterialsResponse
 */
async function getEditingProjectMaterialsWithOptions(request: GetEditingProjectMaterialsRequest, runtime: $RuntimeOptions): GetEditingProjectMaterialsResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.materialType)) {
    query['MaterialType'] = request.materialType;
  }
  if (!$isNull(request.ownerAccount)) {
    query['OwnerAccount'] = request.ownerAccount;
  }
  if (!$isNull(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!$isNull(request.projectId)) {
    query['ProjectId'] = request.projectId;
  }
  if (!$isNull(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!$isNull(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  if (!$isNull(request.type)) {
    query['Type'] = request.type;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'GetEditingProjectMaterials',
    version = '2017-03-21',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Queries materials to be edited for an online editing project.
 *
 * @description During editing, you can add materials to the timeline, but some of them may not be used.
 *
 * @param request GetEditingProjectMaterialsRequest
 * @return GetEditingProjectMaterialsResponse
 */
async function getEditingProjectMaterials(request: GetEditingProjectMaterialsRequest): GetEditingProjectMaterialsResponse {
  var runtime = new $RuntimeOptions{};
  return getEditingProjectMaterialsWithOptions(request, runtime);
}

model GetImageInfoRequest {
  authTimeout?: long(name='AuthTimeout', description='The time when the image URL expires. Unit: seconds.

*   If you set OutputType to cdn:

    *   This parameter takes effect only if URL authentication is enabled. Otherwise, the image URL does not expire.
    *   Minimum value: 1.
    *   Maximum value: unlimited.
    *   Default value: If you leave this parameter empty, the default validity period that is specified in URL signing is used.

*   If you set OutputType to oss:

    *   This parameter takes effect only when the ACL of the Object Storage Service (OSS) bucket is private. Otherwise, the image URL does not expire.
    *   Minimum value: 1.
    *   If you store the image in the VOD bucket, the maximum value of this parameter is **2592000** (30 days). If you store the image in an OSS bucket, the maximum value of this parameter is **129600** (36 hours). The maximum value is limited to reduce security risks of the origin.
    *   Default value: 3600.', example='3600'),
  imageId?: string(name='ImageId', description='The ID of the image. You can use one of the following methods to obtain the ID:

*   Log on to the [ApsaraVideo VOD console](https://vod.console.aliyun.com/). In the left-side navigation pane, choose Media Files > Image. On the Image page, view the image ID.
*   Obtain the image ID from the response to the [CreateUploadImage](~~CreateUploadImage~~) operation that you call to obtain the upload URL and credential.
*   Obtain the image ID from the response to the [SearchMedia](~~SearchMedia~~) operation that you call to query the image.

This parameter is required.', example='3e34733b40b9a96ccf5c1ff6f69****'),
  outputType?: string(name='OutputType', description='The type of the output image URL. Valid values:

*   oss: OSS URL
*   cdn: CDN URL', example='cdn'),
}

model GetImageInfoResponseBody = {
  imageInfo?: {
    appId?: string(name='AppId', description='The ID of the application.', example='app-****'),
    cateId?: long(name='CateId', description='The ID of the category.', example='254766071'),
    cateName?: string(name='CateName', description='The name of the category.', example='test name'),
    creationTime?: string(name='CreationTime', description='The time when the image was created. The time follows the ISO 8601 standard in the *yyyy-MM-dd*T*HH:mm:ss*Z format. The time is displayed in UTC.', example='2018-11-21T02:37:23Z'),
    description?: string(name='Description', description='The description of the image.', example='test description'),
    imageId?: string(name='ImageId', description='The ID of the image.', example='bbc65bba53f9*****ed90de118a7849'),
    imageType?: string(name='ImageType', description='The type of the image. Valid values:

*   **CoverSnapshot**: thumbnail snapshot.
*   **NormalSnapshot**: normal snapshot.
*   **SpriteSnapshot**: sprite snapshot.
*   **SpriteOriginSnapshot**: sprite source snapshot.
*   **All**: images of all the preceding types. Multiple types other than All can return for this parameter. Multiple types are separated by commas (,).', example='NormalSnapshot'),
    mezzanine?: {
      fileSize?: string(name='FileSize', description='The size of the image. Unit: bytes.', example='8932'),
      fileURL?: string(name='FileURL', description='The OSS URL of the image file.', example='https://outin-bfefbb*****163e1c7426.oss-cn-XXXXXXXX.aliyuncs.com/image/default/5E84CD536*****D4DAD.png?Expires=1590982353&OSSAccessKeyId=*****&Signature=ALPET74o*****c%3D'),
      height?: int32(name='Height', description='The height of the image. Unit: pixels.', example='200'),
      originalFileName?: string(name='OriginalFileName', description='The URL of the source file.', example='****.gif'),
      width?: int32(name='Width', description='The width of the image. Unit: pixels.', example='200'),
    }(name='Mezzanine', description='The source information about the image.'),
    status?: string(name='Status', description='The status of the image. Valid values:

*   **Uploading**: The image is being uploaded. This is the initial status.
*   **Normal**: The image is uploaded.
*   **UploadFail**: The image fails to be uploaded.', example='Uploading'),
    storageLocation?: string(name='StorageLocation', description='The bucket in which the image is stored.', example='outin-****..oss-cn-shanghai.aliyuncs.com'),
    tags?: string(name='Tags', description='The tags of the image. Multiple tags are separated by commas (,).', example='tag1,tag2,tag3'),
    title?: string(name='Title', description='The title of the image.', example='this is a sample'),
    URL?: string(name='URL', description='The image URL. If a domain name for CDN is specified, a CDN URL is returned. Otherwise, an OSS URL is returned.', example='http://example.aliyundoc.com/image/default/****.gif?auth_key=****'),
  }(name='ImageInfo', description='The information about the image.'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='AB99D4DF-FAFA-49DC-9C548C1E261E****'),
}

model GetImageInfoResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: GetImageInfoResponseBody(name='body'),
}

/**
 * @summary Queries the basic information and access URL of an image based on the image ID.
 *
 * @param request GetImageInfoRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return GetImageInfoResponse
 */
async function getImageInfoWithOptions(request: GetImageInfoRequest, runtime: $RuntimeOptions): GetImageInfoResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.authTimeout)) {
    query['AuthTimeout'] = request.authTimeout;
  }
  if (!$isNull(request.imageId)) {
    query['ImageId'] = request.imageId;
  }
  if (!$isNull(request.outputType)) {
    query['OutputType'] = request.outputType;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'GetImageInfo',
    version = '2017-03-21',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Queries the basic information and access URL of an image based on the image ID.
 *
 * @param request GetImageInfoRequest
 * @return GetImageInfoResponse
 */
async function getImageInfo(request: GetImageInfoRequest): GetImageInfoResponse {
  var runtime = new $RuntimeOptions{};
  return getImageInfoWithOptions(request, runtime);
}

model GetImageInfosRequest {
  authTimeout?: long(name='AuthTimeout', description='The time when the image URL expires. Unit: seconds.

*   If the OutputType parameter is set to cdn:

    *   This parameter takes effect only if URL authentication is enabled. Otherwise, the image URL does not expire.
    *   Minimum value: 1.
    *   Maximum value: unlimited.
    *   Default value: The default validity period that is specified in URL authentication is used.

*   If the OutputType parameter is set to oss:

    *   This parameter takes effect only when the ACL of the Object Storage Service (OSS) bucket is private. Otherwise, the image URL does not expire.
    *   Minimum value: 1.
    *   If you store the image in the VOD bucket, the maximum value of this parameter is **2592000** (30 days). If you store the image in an OSS bucket, the maximum value of this parameter is **129600** (36 hours). The maximum value is limited to reduce security risks of the origin.
    *   Default value: 3600.', example='3600'),
  imageIds?: string(name='ImageIds', description='The image IDs. Separate multiple IDs with commas (,). You can specify up to 20 image IDs. You can use one of the following methods to obtain the ID:

*   Log on to the [ApsaraVideo VOD console](https://vod.console.aliyun.com/) and choose **Media Files > Images** in the left-side navigation pane.
*   Obtain the value of ImageId from the response to the CreateUploadImage operation that you call to obtain the upload URL and credential.
*   Obtain the value of ImageId from the response to the [SearchMedia](~~SearchMedia~~) operation after you upload images.

This parameter is required.', example='bbc65bba53fed90de118a7849****,594228cdd14b4d069fc17a8c4a****'),
  outputType?: string(name='OutputType', description='The type of the output image URL. Valid values:

*   oss: OSS URL
*   cdn: CDN URL', example='cdn'),
}

model GetImageInfosResponseBody = {
  imageInfo?: [ 
    {
      appId?: string(name='AppId', description='The ID of the application.', example='app-****'),
      cateId?: long(name='CateId', description='The ID of the category.', example='254766071'),
      cateName?: string(name='CateName', description='The name of the category.', example='Test'),
      creationTime?: string(name='CreationTime', description='The time when the image was created. The time follows the ISO 8601 standard in the *yyyy-MM-dd*T*HH:mm:ss*Z format. The time is displayed in UTC.', example='2018-11-21T02:37:23Z'),
      description?: string(name='Description', description='The description of the image.', example='Test description'),
      imageId?: string(name='ImageId', description='The ID of the image.', example='bbc65bba53f9*****ed90de118a7849'),
      imageType?: string(name='ImageType', description='The type of the image. Valid values:

*   **default**: regular images
*   **cover**: video thumbnail', example='NormalSnapshot'),
      mezzanine?: {
        fileSize?: string(name='FileSize', description='The size of the file to be uploaded. Unit: bytes.', example='8932'),
        fileURL?: string(name='FileURL', description='The OSS URL of the image file.', example='https://outin-bfefbb*****163e1c7426.oss-cn-XXXXXXXX.aliyuncs.com/image/default/5E84CD536*****D4DAD.png?Expires=1590982353&OSSAccessKeyId=*****&Signature=ALPET74o*****c%3D'),
        height?: int32(name='Height', description='The height of the image. Unit: pixels.', example='200'),
        originalFileName?: string(name='OriginalFileName', description='The URL of the source file.', example='****.gif'),
        width?: int32(name='Width', description='The width of the image. Unit: pixels.', example='200'),
      }(name='Mezzanine', description='The source information about the image.'),
      status?: string(name='Status', description='The status of the image file. Valid values:

*   **Uploading**: The image is being uploaded. This is the initial status.
*   **Normal**: The image is uploaded.
*   **UploadFail**: The image fails to be uploaded.', example='Uploading'),
      storageLocation?: string(name='StorageLocation', description='The bucket in which the image is stored.', example='outin-****..oss-cn-shanghai.aliyuncs.com'),
      tags?: string(name='Tags', description='The tags of the image. Multiple tags are separated by commas (,).', example='tag1,tag2,tag3'),
      title?: string(name='Title', description='The title of the image.', example='this is a sample'),
      URL?: string(name='URL', description='The image URL. If a domain name for CDN is specified, a CDN URL is returned. Otherwise, an OSS URL is returned.', example='http://example.aliyundoc.com/image/default/****.gif?auth_key=****'),
    }
  ](name='ImageInfo', description='The image information.'),
  nonExistImageIds?: [ string ](name='NonExistImageIds', description='The IDs of the images that do not exist.'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='25818875-5F78-4AF6-D7393642CA58*****'),
}

model GetImageInfosResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: GetImageInfosResponseBody(name='body'),
}

/**
 * @summary Queries the basic information about multiple images at a time.
 *
 * @description *   You can call the [CreateUploadImage](~~CreateUploadImage~~) operation to upload images to ApsaraVideo VOD and call this operation to query the basic information about multiple images at a time.
 * *   To query information about video snapshots, call the [ListSnapshots](~~ListSnapshots~~) operation.
 * *   You can specify up to 20 image IDs in one call.
 *
 * @param request GetImageInfosRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return GetImageInfosResponse
 */
async function getImageInfosWithOptions(request: GetImageInfosRequest, runtime: $RuntimeOptions): GetImageInfosResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.authTimeout)) {
    query['AuthTimeout'] = request.authTimeout;
  }
  if (!$isNull(request.imageIds)) {
    query['ImageIds'] = request.imageIds;
  }
  if (!$isNull(request.outputType)) {
    query['OutputType'] = request.outputType;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'GetImageInfos',
    version = '2017-03-21',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Queries the basic information about multiple images at a time.
 *
 * @description *   You can call the [CreateUploadImage](~~CreateUploadImage~~) operation to upload images to ApsaraVideo VOD and call this operation to query the basic information about multiple images at a time.
 * *   To query information about video snapshots, call the [ListSnapshots](~~ListSnapshots~~) operation.
 * *   You can specify up to 20 image IDs in one call.
 *
 * @param request GetImageInfosRequest
 * @return GetImageInfosResponse
 */
async function getImageInfos(request: GetImageInfosRequest): GetImageInfosResponse {
  var runtime = new $RuntimeOptions{};
  return getImageInfosWithOptions(request, runtime);
}

model GetJobDetailRequest {
  jobId?: string(name='JobId', description='The ID of the task.

This parameter is required.', example='5c9dff***************59d50a967f5'),
  jobType?: string(name='JobType', description='The task type. Valid values:

*   transcode
*   snapshot
*   ai

This parameter is required.', example='transcode'),
}

model GetJobDetailResponseBody = {
  AIJobDetail?: {
    completeTime?: string(name='CompleteTime', description='The end time of the task.', example='2024-10-14T07:39:46Z'),
    createTime?: string(name='CreateTime', description='The time when the task was created. The time follows the ISO 8601 standard in the YYYY-MM-DDTHH:mm:ssZ format. The time is displayed in UTC.', example='2024-10-14T07:39:25Z'),
    jobId?: string(name='JobId', description='The ID of the task.', example='5c9dff751ba**********59d50a967f5'),
    jobType?: string(name='JobType', description='The type of the AI task.', example='AIVideoCensor'),
    mediaId?: string(name='MediaId', description='The ID of the media asset.', example='30e5d7**********bd900764de7c0102'),
    status?: string(name='Status', description='The status of the task. Valid values:

*   reserved
*   init
*   success
*   fail
*   processing
*   analysing', example='success'),
    templateConfig?: string(name='TemplateConfig', description='The template configuration.', example='{"AuditRange":["video","image-cover","text-title"],"AuditContent":["screen"],"AuditItem":["terrorism","porn"],"AuditAutoBlock":"no"}'),
    trigger?: string(name='Trigger', description='The trigger mode. Valid values:

*   Auto
*   Manual', example='Auto'),
    userId?: long(name='UserId', description='The ID of the user who submitted the task.', example='139109*****84930'),
  }(name='AIJobDetail', description='The details of the AI task. This parameter takes effect only when the TaskType parameter is set to AI.'),
  jobType?: string(name='JobType', description='The type of the task. Valid values:', example='transcode'),
  requestId?: string(name='RequestId', description='The request ID.', example='6708D849-F109-1A6C-AC91-************'),
  snapshotJobDetail?: {
    completeTime?: string(name='CompleteTime', description='The time when the task was complete.', example='2024-10-14T07:39:45Z'),
    createTime?: string(name='CreateTime', description='The time when the task was created. The time follows the ISO 8601 standard in the YYYY-MM-DDTHH:mm:ssZ format. The time is displayed in UTC.', example='2024-10-14T07:39:25Z'),
    jobId?: string(name='JobId', description='The ID of the task.', example='63df12s0**********4hdq249t82kr91'),
    normalConfig?: string(name='NormalConfig', description='Configuration of normal snapshots.', example='{"inl":0,"num":32,"tm":5,"wd":"352","ft":"normal","hg":"640"}'),
    spriteConfig?: string(name='SpriteConfig', description='The sprite configuration.', example='{"pad":"0","lines":"10","mgin":"0","cols":"10","ikcp":"false","hg":"68"}'),
    status?: string(name='Status', description='The status of the task. Valid values:

*   Processing
*   Fail
*   Success', example='Success'),
    trigger?: string(name='Trigger', description='The trigger mode. Valid values:

*   Auto
*   Manual', example='Auto'),
    userId?: long(name='UserId', description='The ID of the user who submitted the task.', example='139109*****84930'),
    videoId?: string(name='VideoId', description='The ID of the media asset.', example='30e5d7**********bd900764de7c0102'),
  }(name='SnapshotJobDetail', description='The details of the snapshot task. This parameter takes effect only when the jobType parameter is set to Snapshot.'),
  transcodeJobDetail?: {
    completeTime?: string(name='CompleteTime', description='The time when the task was complete.', example='2024-10-14T07:39:34Z'),
    createTime?: string(name='CreateTime', description='The time when the task was created. The time follows the ISO 8601 standard in the YYYY-MM-DDTHH:mm:ssZ format. The time is displayed in UTC.', example='2024-10-14T07:39:25Z'),
    definition?: string(name='Definition', description='The definition.', example='HD'),
    jobId?: string(name='JobId', description='The ID of the task.', example='2dc1634e**********3f1d22d1a0174e'),
    status?: string(name='Status', description='The status of the task. Valid values:

*   Submitted
*   Transcoding
*   TranscodeSuccess
*   TranscodeFail
*   TranscodeCancelled', example='TranscodeSuccess'),
    templateId?: string(name='TemplateId', description='The ID of the template.', example='dbfaaec9e**********bf0b81219244c'),
    userId?: long(name='UserId', description='The ID of the user who submitted the task.', example='139109*****84930'),
    videoId?: string(name='VideoId', description='The ID of the media asset.', example='30e5d7**********bd900764de7c0102'),
  }(name='TranscodeJobDetail', description='The details of the transcoding task. This parameter takes effect only when the jobType parameter is set to Transcode.'),
  workflowTaskDetail?: {
    activityResults?: string(name='ActivityResults'),
    createTime?: string(name='CreateTime'),
    finishTime?: string(name='FinishTime'),
    status?: string(name='Status'),
    taskId?: string(name='TaskId'),
    taskInput?: string(name='TaskInput'),
    userData?: string(name='UserData'),
    workflow?: {
      appId?: string(name='AppId'),
      createTime?: string(name='CreateTime'),
      modifiedTime?: string(name='ModifiedTime'),
      name?: string(name='Name'),
      status?: string(name='Status'),
      type?: string(name='Type'),
      workflowId?: string(name='WorkflowId'),
    }(name='Workflow'),
  }(name='WorkflowTaskDetail'),
}

model GetJobDetailResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: GetJobDetailResponseBody(name='body'),
}

/**
 * @summary Queries the details of an asynchronous task based on jobId.
 *
 * @description ****
 * You can call this operation to query only asynchronous tasks of the last six months. The types of tasks that you can query include transcoding tasks, snapshot tasks, and AI tasks.
 * **QPS limit**
 * You can call this operation up to 15 times per second per account. Requests that exceed this limit are dropped and you will experience service interruptions. We recommend that you take note of this limit when you call this operation. For more information, see [QPS limits](https://help.aliyun.com/document_detail/342790.html).
 *
 * @param request GetJobDetailRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return GetJobDetailResponse
 */
async function getJobDetailWithOptions(request: GetJobDetailRequest, runtime: $RuntimeOptions): GetJobDetailResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.jobId)) {
    query['JobId'] = request.jobId;
  }
  if (!$isNull(request.jobType)) {
    query['JobType'] = request.jobType;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'GetJobDetail',
    version = '2017-03-21',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Queries the details of an asynchronous task based on jobId.
 *
 * @description ****
 * You can call this operation to query only asynchronous tasks of the last six months. The types of tasks that you can query include transcoding tasks, snapshot tasks, and AI tasks.
 * **QPS limit**
 * You can call this operation up to 15 times per second per account. Requests that exceed this limit are dropped and you will experience service interruptions. We recommend that you take note of this limit when you call this operation. For more information, see [QPS limits](https://help.aliyun.com/document_detail/342790.html).
 *
 * @param request GetJobDetailRequest
 * @return GetJobDetailResponse
 */
async function getJobDetail(request: GetJobDetailRequest): GetJobDetailResponse {
  var runtime = new $RuntimeOptions{};
  return getJobDetailWithOptions(request, runtime);
}

model GetMediaAuditAudioResultDetailRequest {
  mediaId?: string(name='MediaId', description='The ID of the video. You can query the video ID by using the ApsaraVideo VOD console or calling the [SearchMedia](https://help.aliyun.com/document_detail/86044.html) operation.

This parameter is required.', example='93ab850b4f6f*****54b6e91d24d81d4'),
  ownerAccount?: string(name='OwnerAccount'),
  ownerId?: string(name='OwnerId'),
  pageNo?: int32(name='PageNo', description='The number of the page to return. This parameter is optional. If you do not specify this parameter, all results are returned without pagination.', example='1'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: string(name='ResourceOwnerId'),
}

model GetMediaAuditAudioResultDetailResponseBody = {
  mediaAuditAudioResultDetail?: {
    list?: [ 
      {
        endTime?: long(name='EndTime', description='The end time of the audio that failed the review. Unit: seconds.', example='10'),
        label?: string(name='Label', description='The review results. Valid values:
*   **spam**
*   **ad**
*   **abuse**
*   **flood**
*   **contraband**
*   **meaningless**
*   **normal**', example='abuse'),
        startTime?: long(name='StartTime', description='The start time of the audio that failed the review. Unit: seconds.', example='8'),
        text?: string(name='Text', description='The text that corresponds to the audio.', example='beauty'),
      }
    ](name='List', description='The list of results.'),
    pageTotal?: int32(name='PageTotal', description='The page number of the returned page.', example='1'),
    total?: int32(name='Total', description='The total number of pages returned.', example='10'),
  }(name='MediaAuditAudioResultDetail', description='Details of review results.'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='CB7D7232-1AB2-40FE-B8D3-****'),
}

model GetMediaAuditAudioResultDetailResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: GetMediaAuditAudioResultDetailResponseBody(name='body'),
}

/**
 * @summary Queries the details of audio review results.
 *
 * @description If notifications for the [CreateAuditComplete](https://help.aliyun.com/document_detail/89576.html) event are configured, event notifications are sent to the callback URL after automated review is complete. You can call this operation to query the details of audio review results.
 *
 * @param request GetMediaAuditAudioResultDetailRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return GetMediaAuditAudioResultDetailResponse
 */
async function getMediaAuditAudioResultDetailWithOptions(request: GetMediaAuditAudioResultDetailRequest, runtime: $RuntimeOptions): GetMediaAuditAudioResultDetailResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.mediaId)) {
    query['MediaId'] = request.mediaId;
  }
  if (!$isNull(request.ownerAccount)) {
    query['OwnerAccount'] = request.ownerAccount;
  }
  if (!$isNull(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!$isNull(request.pageNo)) {
    query['PageNo'] = request.pageNo;
  }
  if (!$isNull(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!$isNull(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'GetMediaAuditAudioResultDetail',
    version = '2017-03-21',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Queries the details of audio review results.
 *
 * @description If notifications for the [CreateAuditComplete](https://help.aliyun.com/document_detail/89576.html) event are configured, event notifications are sent to the callback URL after automated review is complete. You can call this operation to query the details of audio review results.
 *
 * @param request GetMediaAuditAudioResultDetailRequest
 * @return GetMediaAuditAudioResultDetailResponse
 */
async function getMediaAuditAudioResultDetail(request: GetMediaAuditAudioResultDetailRequest): GetMediaAuditAudioResultDetailResponse {
  var runtime = new $RuntimeOptions{};
  return getMediaAuditAudioResultDetailWithOptions(request, runtime);
}

model GetMediaAuditResultRequest {
  mediaId?: string(name='MediaId', description='The ID of the video or image.

This parameter is required.', example='93ab850b4f6f*****54b6e91d24d81d4'),
}

model GetMediaAuditResultResponseBody = {
  mediaAuditResult?: {
    abnormalModules?: string(name='AbnormalModules', description='The content that violates the regulations. Separate multiple values with commas (,). Valid values:

*   **video**
*   **image-cover**
*   **text-title**', example='video'),
    audioResult?: [ 
      {
        label?: string(name='Label', description='The category of the review result.

*   **normal**
*   **spam**
*   **ad**
*   **politics**
*   **terrorism**
*   **abuse**
*   **porn**
*   **flood**
*   **contraband**
*   **meaningless**', example='normal'),
        scene?: string(name='Scene', description='The review scenario. The value is **antispam**.', example='antispam'),
        score?: string(name='Score', description='The score.', example='99.91'),
        suggestion?: string(name='Suggestion', description='The recommendation for review results. Valid values:

*   **block**
*   **review**
*   **pass**', example='pass'),
      }
    ](name='AudioResult', description='The results of audio review.'),
    imageResult?: [ 
      {
        label?: string(name='Label', description='The category of the review result. Separate multiple values with commas (,). Valid values:

*   **porn**
*   **terrorism**
*   **normal**', example='porn'),
        result?: [ 
          {
            label?: string(name='Label', description='The category of the review result.

Valid values if scene is **porn**:

*   **porn**
*   **sexy**
*   **normal**

Valid values if scene is **terrorism**:

*   **normal**
*   **bloody**
*   **explosion**
*   **outfit**
*   **logo**
*   **weapon**
*   **politics**
*   **violence**
*   **crowd**
*   **parade**
*   **carcrash**
*   **flag**
*   **location**
*   **others**', example='porn'),
            scene?: string(name='Scene', description='The review scenario. Valid values:

*   **terrorism**
*   **porn**', example='porn'),
            score?: string(name='Score', description='The score of the image of the category that is indicated by Label.', example='100.00000'),
            suggestion?: string(name='Suggestion', description='The recommendation for review results. Valid values:

*   **block**
*   **review**
*   **pass**', example='pass'),
          }
        ](name='Result', description='Details of image review results.'),
        suggestion?: string(name='Suggestion', description='The recommendation for review results. Valid values:

*   **block**
*   **review**
*   **pass**', example='pass'),
        type?: string(name='Type', description='The type of the image. The value is **cover**.', example='cover'),
        url?: string(name='Url', description='The URL of the image.', example='http://www.test.com/****.jpg'),
      }
    ](name='ImageResult', description='The results of image review.'),
    label?: string(name='Label', description='The category of the review result. Separate multiple values with commas (,). Valid values:

*   **porn**
*   **terrorism**
*   **normal**', example='porn'),
    suggestion?: string(name='Suggestion', description='The recommendation for review results. Valid values:

*   **block**
*   **review**
*   **pass**', example='pass'),
    textResult?: [ 
      {
        content?: string(name='Content', description='The text content for review.', example='hot line 123****'),
        label?: string(name='Label', description='The category of the review result. Valid values:

- **spam**
- **ad**
- **abuse**
- **flood**
- **contraband**
- **meaningless**
- **normal**', example='ad'),
        scene?: string(name='Scene', description='The review scenario. The value is **antispam**.', example='antispam'),
        score?: string(name='Score', description='The score of the image of the category that is indicated by Label.', example='100.00000'),
        suggestion?: string(name='Suggestion', description='The recommendation for review results. Valid values:

- **block**
- **review**
- **pass**', example='pass'),
        type?: string(name='Type', description='The type of the text. The value is **title**.', example='title'),
      }
    ](name='TextResult', description='The results of text review.'),
    videoResult?: {
      adResult?: {
        averageScore?: string(name='AverageScore', description='The average score of the review results.', example='100'),
        counterList?: [ 
          {
            count?: int32(name='Count', description='The number of frames.', example='12'),
            label?: string(name='Label', description='The category of the review result. Valid values:

- **ad**
- **normal**', example='ad'),
          }
        ](name='CounterList', description='The statistics about tag frames.'),
        label?: string(name='Label', description='The category of the review result. Valid values:

- **ad**
- **normal**', example='ad'),
        maxScore?: string(name='MaxScore', description='The highest review score.', example='100'),
        suggestion?: string(name='Suggestion', description='The recommendation for review results. Valid values:

- **block**
- **review**
- **pass**', example='block'),
        topList?: [ 
          {
            label?: string(name='Label', description='The category of the review result. 

- **ad**
- **normal**', example='ad'),
            score?: string(name='Score', description='The score of the image of the category that is indicated by Label.', example='100'),
            timestamp?: string(name='Timestamp', description='The position in the video. Unit: milliseconds.', example='10'),
            url?: string(name='Url', description='The URL of the image.', example='http://temp-testbucket.oss-cn-shanghai.aliyuncs.com/aivideocensor/****.jpg'),
          }
        ](name='TopList', description='The information about the image with the highest score of the category that is indicated by Label.'),
      }(name='AdResult', description='The results of ad review.'),
      label?: string(name='Label', description='The category of the review result. Separate multiple values with commas (,). Valid values: 

- **porn**
- **terrorism**
- **normal**', example='porn'),
      liveResult?: {
        averageScore?: string(name='AverageScore', description='The average score of the review results.', example='100'),
        counterList?: [ 
          {
            count?: int32(name='Count', description='The number of frames.', example='2'),
            label?: string(name='Label', description='The category of the review result. Valid values:

- **live**: The content contains undesirable scenes.
- **normal**: normal content.', example='live'),
          }
        ](name='CounterList', description='The statistics about tag frames.'),
        label?: string(name='Label', description='The category of the review result. Valid values:

- **live**: The content contains undesirable scenes.
- **normal**: normal content.', example='live'),
        maxScore?: string(name='MaxScore', description='The highest review score.', example='100'),
        suggestion?: string(name='Suggestion', description='The recommendation for review results. Valid values:

- **block**
- **review**
- **pass**', example='block'),
        topList?: [ 
          {
            label?: string(name='Label', description='The category of the review result. Valid values:

- **live**: The content contains undesirable scenes.
- **normal**: normal content.', example='normal'),
            score?: string(name='Score', description='The score of the image of the category that is indicated by Label.', example='100'),
            timestamp?: string(name='Timestamp', description='The position in the video. Unit: milliseconds.', example='10'),
            url?: string(name='Url', description='The URL of the image.', example='http://temp-testbucket.oss-cn-shanghai.aliyuncs.com/aivideocensor/****.jpg'),
          }
        ](name='TopList', description='The information about the image with the highest score of the category that is indicated by Label.'),
      }(name='LiveResult', description='The results of undesired content review.'),
      logoResult?: {
        averageScore?: string(name='AverageScore', description='The average score of the review results.', example='100'),
        counterList?: [ 
          {
            count?: int32(name='Count', description='The number of frames.', example='1'),
            label?: string(name='Label', description='The category of the review result. Valid values:

- **logo**
- **normal**', example='logo'),
          }
        ](name='CounterList', description='The statistics about tag frames.'),
        label?: string(name='Label', description='The category of the review result. Valid values:

- **logo**
- **normal**', example='logo'),
        maxScore?: string(name='MaxScore', description='The highest review score.', example='100'),
        suggestion?: string(name='Suggestion', description='The recommendation for review results. Valid values:

- **block**
- **review**
- **pass**', example='block'),
        topList?: [ 
          {
            label?: string(name='Label', description='The category of the review result.

- **logo**
- **normal**', example='logo'),
            score?: string(name='Score', description='The score of the image of the category that is indicated by Label.', example='100'),
            timestamp?: string(name='Timestamp', description='The position in the video. Unit: milliseconds.', example='16'),
            url?: string(name='Url', description='The URL of the image.', example='http://temp-testbucket.oss-cn-shanghai.aliyuncs.com/aivideocensor/****.jpg'),
          }
        ](name='TopList', description='The information about the image with the highest score of the category that is indicated by Label.'),
      }(name='LogoResult', description='The results of logo review.'),
      pornResult?: {
        averageScore?: string(name='AverageScore', description='The average score of the review results.', example='100'),
        counterList?: [ 
          {
            count?: int32(name='Count', description='The number of frames.', example='1'),
            label?: string(name='Label', description='The category of the review result. Valid values:

- **porn**
- **sexy**
- **normal**', example='porn'),
          }
        ](name='CounterList', description='The statistics about tag frames.'),
        label?: string(name='Label', description='The category of the review result. Valid values:

- **porn**
- **sexy**
- **normal**', example='porn'),
        maxScore?: string(name='MaxScore', description='The highest review score.', example='100'),
        suggestion?: string(name='Suggestion', description='The recommendation for review results.', example='pass'),
        topList?: [ 
          {
            label?: string(name='Label', description='The category of the review result. Valid values:

- **porn**
- **sexy**
- **normal**', example='porn'),
            score?: string(name='Score', description='The score of the image of the category that is indicated by Label.', example='100.0000'),
            timestamp?: string(name='Timestamp', description='The position in the video. Unit: milliseconds.', example='3005'),
            url?: string(name='Url', description='The URL of the image.', example='http://temp-testbucket.oss-cn-shanghai.aliyuncs.com/aivideocensor/****.jpg'),
          }
        ](name='TopList', description='The information about the image with the highest score of the category that is indicated by Label.'),
      }(name='PornResult', description='The results of pornographic content review.'),
      suggestion?: string(name='Suggestion', description='The recommendation for review results. Valid values:

- **block**
- **review**
- **pass**', example='pass'),
      terrorismResult?: {
        averageScore?: string(name='AverageScore', description='The average score of the review results.', example='100'),
        counterList?: [ 
          {
            count?: int32(name='Count', description='The number of frames.', example='1'),
            label?: string(name='Label', description='The category of the review result. Valid values:

- **normal**
- **bloody**
- **explosion**
- **outfit**
- **logo**
- **weapon**
- **politics**
- **violence**
- **crowd**
- **parade**
- **carcrash**
- **flag**
- **location**
- **others**', example='outfit'),
          }
        ](name='CounterList', description='The statistics about tag frames.'),
        label?: string(name='Label', description='The category of the review result. Valid values:

- **normal**
- **bloody**
- **explosion**
- **outfit**
- **logo**
- **weapon**
- **politics**
- **violence**
- **crowd**
- **parade**
- **carcrash**
- **flag**
- **location**
- **others**', example='normal'),
        maxScore?: string(name='MaxScore', description='The highest review score.', example='100'),
        suggestion?: string(name='Suggestion', description='The recommendation for review results. Valid values:

- **block**
- **review**
- **pass**', example='pass'),
        topList?: [ 
          {
            label?: string(name='Label', description='The category of the review result. Valid values:

- **normal**
- **bloody**
- **explosion**
- **outfit**
- **logo**
- **weapon**
- **politics**
- **violence**
- **crowd**
- **parade**
- **carcrash**
- **flag**
- **location**
- **others**', example='normal'),
            score?: string(name='Score', description='The score of the image of the category that is indicated by Label.', example='100.000'),
            timestamp?: string(name='Timestamp', description='The position in the video. Unit: milliseconds.', example='3005'),
            url?: string(name='Url', description='The URL of the image.', example='http://temp-testbucket.oss-cn-shanghai.aliyuncs.com/aivideocensor/****.jpg'),
          }
        ](name='TopList', description='The information about the image with the highest score of the category that is indicated by Label.'),
      }(name='TerrorismResult', description='The results of terrorist content review.'),
    }(name='VideoResult', description='The results of video review.'),
  }(name='MediaAuditResult', description='The review results.'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='CB7D7232-1AB2-40FE-B8D5-****'),
}

model GetMediaAuditResultResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: GetMediaAuditResultResponseBody(name='body'),
}

/**
 * @summary Queries the summary of automated review results.
 *
 * @param request GetMediaAuditResultRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return GetMediaAuditResultResponse
 */
async function getMediaAuditResultWithOptions(request: GetMediaAuditResultRequest, runtime: $RuntimeOptions): GetMediaAuditResultResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.mediaId)) {
    query['MediaId'] = request.mediaId;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'GetMediaAuditResult',
    version = '2017-03-21',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Queries the summary of automated review results.
 *
 * @param request GetMediaAuditResultRequest
 * @return GetMediaAuditResultResponse
 */
async function getMediaAuditResult(request: GetMediaAuditResultRequest): GetMediaAuditResultResponse {
  var runtime = new $RuntimeOptions{};
  return getMediaAuditResultWithOptions(request, runtime);
}

model GetMediaAuditResultDetailRequest {
  mediaId?: string(name='MediaId', description='The ID of the video.

This parameter is required.', example='93ab850b4f6f*****54b6e91d24d81d4'),
  pageNo?: int32(name='PageNo', description='The page number. The default value is **1**. A maximum of **20** records can be returned on each page.

This parameter is required.', example='1'),
}

model GetMediaAuditResultDetailResponseBody = {
  mediaAuditResultDetail?: {
    list?: [ 
      {
        adLabel?: string(name='AdLabel', description='The category of the review result. Valid values:

*   **normal**: normal content.
*   **ad**: other ads.
*   **politics**: political content in text.
*   **porn**: pornographic content in text.
*   **abuse**: verbal abuse in text.
*   **terrorism**: terrorist content in text.
*   **contraband**: prohibited content in text.
*   **spam**: spam content in text.
*   **npx**: illegal ad
*   **qrcode**: QR code.
*   **programCode**: mini program code.', example='normal'),
        adScore?: string(name='AdScore', description='The score of the video snapshot in the ad review result. Valid values: `[0,100]`. The value is rounded down to 10 decimal places. The score is representative of the confidence.', example='100'),
        liveLabel?: string(name='LiveLabel', description='The category of the review result. Valid values:

*   **normal**: normal content.
*   **meaningless**: meaningless content, such as a black or white screen.
*   **PIP**: picture-in-picture.
*   **smoking**: smoking.
*   **drivelive**: live broadcasting in a running vehicle.', example='normal'),
        liveScore?: string(name='LiveScore', description='The score of the video snapshot in the undesirable content review result. Valid values: `[0,100]`. The value is rounded down to 10 decimal places. The score is representative of the confidence.', example='100'),
        logoLabel?: string(name='LogoLabel', description='The category of the review result. Valid values:

*   **normal**: normal content.
*   **TV**: controlled TV station logo.
*   **trademark**: trademark.', example='normal'),
        logoScore?: string(name='LogoScore', description='The score of the video snapshot in the logo review result. Valid values: `[0,100]`. The value is rounded down to 10 decimal places. The score is representative of the confidence.', example='100'),
        pornLabel?: string(name='PornLabel', description='The category of the review result. Valid values:

*   **normal**
*   **porn**
*   **sexy**', example='normal'),
        pornScore?: string(name='PornScore', description='The score of the video snapshot in the pornographic content review result. Valid values: `[0,100]`. The value is rounded down to 10 decimal places. The score is representative of the confidence.', example='100.00'),
        terrorismLabel?: string(name='TerrorismLabel', description='The category of the review result. Valid values:

*   **normal**
*   **bloody**
*   **explosion**
*   **outfit**
*   **logo**
*   **weapon**
*   **politics**
*   **violence**
*   **crowd**
*   **parade**
*   **carcrash**
*   **flag**
*   **location**
*   **others**', example='normal'),
        terrorismScore?: string(name='TerrorismScore', description='The score of the video snapshot in the terrorist content review result. Valid values: `[0,100]`. The value is rounded down to 10 decimal places. The score is representative of the confidence.', example='100.00'),
        timestamp?: string(name='Timestamp', description='The timestamp of the snapshot in the video. Unit: milliseconds.', example='3005'),
        url?: string(name='Url', description='The URL of the video snapshot.', example='http://temp-testbucket.oss-cn-shanghai.aliyuncs.com/aivideocensor/****.jpg'),
      }
    ](name='List', description='The review results returned.'),
    total?: int32(name='Total', description='The total number of snapshots returned.', example='2'),
  }(name='MediaAuditResultDetail', description='Details about review results.'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='6438BD76-D523-46FC-956F-****'),
}

model GetMediaAuditResultDetailResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: GetMediaAuditResultDetailResponseBody(name='body'),
}

/**
 * @summary Queries the details of automated review results. You can call this operation to query the details of review results in real time.
 *
 * @description *   By default, only details of snapshots that violate content regulations and potentially violate content regulations are returned.
 * *   ApsaraVideo VOD stores the snapshots in the automated review results free of charge for two weeks. After this period, the snapshots are automatically deleted.
 * *   This operation is available only in the Singapore region.
 *
 * @param request GetMediaAuditResultDetailRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return GetMediaAuditResultDetailResponse
 */
async function getMediaAuditResultDetailWithOptions(request: GetMediaAuditResultDetailRequest, runtime: $RuntimeOptions): GetMediaAuditResultDetailResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.mediaId)) {
    query['MediaId'] = request.mediaId;
  }
  if (!$isNull(request.pageNo)) {
    query['PageNo'] = request.pageNo;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'GetMediaAuditResultDetail',
    version = '2017-03-21',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Queries the details of automated review results. You can call this operation to query the details of review results in real time.
 *
 * @description *   By default, only details of snapshots that violate content regulations and potentially violate content regulations are returned.
 * *   ApsaraVideo VOD stores the snapshots in the automated review results free of charge for two weeks. After this period, the snapshots are automatically deleted.
 * *   This operation is available only in the Singapore region.
 *
 * @param request GetMediaAuditResultDetailRequest
 * @return GetMediaAuditResultDetailResponse
 */
async function getMediaAuditResultDetail(request: GetMediaAuditResultDetailRequest): GetMediaAuditResultDetailResponse {
  var runtime = new $RuntimeOptions{};
  return getMediaAuditResultDetailWithOptions(request, runtime);
}

model GetMediaAuditResultTimelineRequest {
  mediaId?: string(name='MediaId', description='The ID of the video.

This parameter is required.', example='93ab850b4f6f*****54b6e91d24d81d4'),
}

model GetMediaAuditResultTimelineResponseBody = {
  mediaAuditResultTimeline?: {
    ad?: [ 
      {
        label?: string(name='Label', description='The category of the review result. Valid values:

*   **normal**: normal content.
*   **ad**: other ads.
*   **politics**: political content in text.
*   **porn**: pornographic content in text.
*   **abuse**: abuse in text.
*   **terrorism**: terrorist content in text.
*   **contraband**: prohibited content in text.
*   **spam**: spam content.
*   **npx**: illegal ad.
*   **qrcode**: QR code.
*   **programCode**: mini program code.', example='ad'),
        score?: string(name='Score', description='The score of the video snapshot in the ad review result. Valid values: `[0,100]`. The value is rounded down to 10 decimal places. The score is representative of the confidence.', example='100'),
        timestamp?: string(name='Timestamp', description='The timestamp of the snapshot in the video. Unit: milliseconds.', example='10'),
      }
    ](name='Ad', description='The collection of ad timelines.'),
    live?: [ 
      {
        label?: string(name='Label', description='The categories of undesired content review results. Valid values:

*   **normal**: normal content.
*   **meaningless**: meaningless content, such as a black or white screen.
*   **PIP**: picture-in-picture.
*   **smoking**: smoking.
*   **drivelive**: live broadcasting in a running vehicle.', example='pip'),
        score?: string(name='Score', description='The score of the video snapshot in the undesirable content review result. Valid values: `[0,100]`. The value is rounded down to 10 decimal places. The score is representative of the confidence.', example='100'),
        timestamp?: string(name='Timestamp', description='The timestamp of the snapshot in the video. Unit: milliseconds.', example='12'),
      }
    ](name='Live', description='The collection of undesirable content timelines.'),
    logo?: [ 
      {
        label?: string(name='Label', description='The category of the review result. Valid values:

*   **normal**: normal content.
*   **TV**: controlled TV station logo.
*   **trademark**: trademark.', example='logo'),
        score?: string(name='Score', description='The score of the video snapshot in the logo review result. Valid values: `[0,100]`. The value is rounded down to 10 decimal places. The score is representative of the confidence.', example='100'),
        timestamp?: string(name='Timestamp', description='The timestamp of the snapshot in the video. Unit: milliseconds.', example='13'),
      }
    ](name='Logo', description='The collection of logo timelines.'),
    porn?: [ 
      {
        label?: string(name='Label', description='The category of the review result. Valid values:

*   **porn**
*   **sexy**
*   **normal**', example='porn'),
        score?: string(name='Score', description='The score of the video snapshot in the pornographic content review result. Valid values: `[0,100]`. The value is rounded down to 10 decimal places. The score is representative of the confidence.', example='100.00'),
        timestamp?: string(name='Timestamp', description='The timestamp of the snapshot in the video. Unit: milliseconds.', example='3005'),
      }
    ](name='Porn', description='The collection of pornographic content timelines.'),
    terrorism?: [ 
      {
        label?: string(name='Label', description='The category of the review result. Valid values:

*   **normal**
*   **bloody**
*   **explosion**
*   **outfit**
*   **logo**
*   **weapon**
*   **politics**
*   **violence**
*   **crowd**
*   **parade**
*   **carcrash**
*   **flag**
*   **location**
*   **others**', example='normal'),
        score?: string(name='Score', description='The score of the video snapshot in the terrorist content review result. Valid values: `[0,100]`. The value is rounded down to 10 decimal places. The score is representative of the confidence.', example='100.00'),
        timestamp?: string(name='Timestamp', description='The timestamp of the snapshot in the video. Unit: milliseconds.', example='3005'),
      }
    ](name='Terrorism', description='The collection of terrorist content timelines.'),
  }(name='MediaAuditResultTimeline', description='The collection of review result timelines.'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='6438BD76-D523-46FC-956F-****'),
}

model GetMediaAuditResultTimelineResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: GetMediaAuditResultTimelineResponseBody(name='body'),
}

/**
 * @summary Queries the timelines of all snapshots that violate content regulations.
 *
 * @description >  By default, only details of snapshots that violate content regulations and potentially violate content regulations are returned.
 * This operation is available only in the Singapore region.
 *
 * @param request GetMediaAuditResultTimelineRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return GetMediaAuditResultTimelineResponse
 */
async function getMediaAuditResultTimelineWithOptions(request: GetMediaAuditResultTimelineRequest, runtime: $RuntimeOptions): GetMediaAuditResultTimelineResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.mediaId)) {
    query['MediaId'] = request.mediaId;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'GetMediaAuditResultTimeline',
    version = '2017-03-21',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Queries the timelines of all snapshots that violate content regulations.
 *
 * @description >  By default, only details of snapshots that violate content regulations and potentially violate content regulations are returned.
 * This operation is available only in the Singapore region.
 *
 * @param request GetMediaAuditResultTimelineRequest
 * @return GetMediaAuditResultTimelineResponse
 */
async function getMediaAuditResultTimeline(request: GetMediaAuditResultTimelineRequest): GetMediaAuditResultTimelineResponse {
  var runtime = new $RuntimeOptions{};
  return getMediaAuditResultTimelineWithOptions(request, runtime);
}

model GetMediaDNAResultRequest {
  mediaId?: string(name='MediaId', description='The ID of the video.

This parameter is required.', example='88c6ca184c0e*****a5b665e2a126797'),
  ownerAccount?: string(name='OwnerAccount'),
  ownerId?: string(name='OwnerId'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: string(name='ResourceOwnerId'),
}

model GetMediaDNAResultResponseBody = {
  DNAResult?: {
    videoDNA?: [ 
      {
        detail?: [ 
          {
            duplication?: {
              duration?: string(name='Duration', description='The duration of the video. Unit: seconds.', example='12.0'),
              start?: string(name='Start', description='The start time of the video. Unit: seconds.', example='2.0'),
            }(name='Duplication', description='The start time and duration of the matched video.'),
            input?: {
              duration?: string(name='Duration', description='The duration of the video. Unit: seconds.', example='12.0'),
              start?: string(name='Start', description='The start time of the video. Unit: seconds.', example='2.0'),
            }(name='Input', description='The start time and duration of the input video.'),
          }
        ](name='Detail', description='The details of the matched video. Information such as the location and duration of the video is returned.'),
        primaryKey?: string(name='PrimaryKey', description='The ID of the video that has a similar fingerprint.', example='6ad8987da46f4b*****490ce2873745'),
        similarity?: string(name='Similarity', description='The similarity between the fingerprints of the input video and the matched video. 1 indicates that the fingerprints of the two videos are the same.', example='0.98'),
      }
    ](name='VideoDNA', description='The video fingerprint recognition result.'),
  }(name='DNAResult', description='The media fingerprinting results.'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='63FC4896-E956-4B*****7D-134FF1BC597A'),
}

model GetMediaDNAResultResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: GetMediaDNAResultResponseBody(name='body'),
}

/**
 * @summary Queries a media fingerprinting result. After a media fingerprinting job is complete, you can call this operation to query the media fingerprinting result.
 *
 * @description Regions that support this operation: **China (Beijing)**, **China (Shanghai)**, and **Singapore**.
 *
 * @param request GetMediaDNAResultRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return GetMediaDNAResultResponse
 */
async function getMediaDNAResultWithOptions(request: GetMediaDNAResultRequest, runtime: $RuntimeOptions): GetMediaDNAResultResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.mediaId)) {
    query['MediaId'] = request.mediaId;
  }
  if (!$isNull(request.ownerAccount)) {
    query['OwnerAccount'] = request.ownerAccount;
  }
  if (!$isNull(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!$isNull(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!$isNull(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'GetMediaDNAResult',
    version = '2017-03-21',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Queries a media fingerprinting result. After a media fingerprinting job is complete, you can call this operation to query the media fingerprinting result.
 *
 * @description Regions that support this operation: **China (Beijing)**, **China (Shanghai)**, and **Singapore**.
 *
 * @param request GetMediaDNAResultRequest
 * @return GetMediaDNAResultResponse
 */
async function getMediaDNAResult(request: GetMediaDNAResultRequest): GetMediaDNAResultResponse {
  var runtime = new $RuntimeOptions{};
  return getMediaDNAResultWithOptions(request, runtime);
}

model GetMediaRefreshJobsRequest {
  mediaId?: string(name='MediaId', description='The ID of the media file. It is the value of the `MediaIds` parameter that you specify when you call the [RefreshMediaPlayUrls](~~RefreshMediaPlayUrls~~) operation. You can specify only one media ID.

If you leave this parameter empty, information about all media files in the refresh or prefetch job specified by `MediaRefreshJobId` is returned. If you set this parameter, only the information about the specified media file is returned.``', example='ca3a8f6e4957b658067095869****'),
  mediaRefreshJobId?: string(name='MediaRefreshJobId', description='The ID of the refresh or prefetch job. It is the value of the MediaRefreshJobId parameter that is returned from the call to the [RefreshMediaPlayUrls](~~RefreshMediaPlayUrls~~) operation.

This parameter is required.', example='41d465e31957****'),
}

model GetMediaRefreshJobsResponseBody = {
  mediaRefreshJobs?: [ 
    {
      errorCode?: string(name='ErrorCode', description='The error code. This parameter is returned if the refresh or prefetch task fails.', example='PreloadQueueFull'),
      errorMessage?: string(name='ErrorMessage', description='The error message. This parameter is returned if the refresh or prefetch task fails.', example='Preload queue is full, please try again later!'),
      filterPolicy?: string(name='FilterPolicy', description='The filtering conditions for stream playback. The value is a JSON string. This parameter is used as a request parameter of the [RefreshMediaPlayUrls](~~RefreshMediaPlayUrls~~) operation.', example='{"Formats":"mp4,m3u8", "Definitions":"HD,SD",  " StreamType":"video",  "ResultType":"Single",  " SliceFlag":false, "SliceCount": 3}'),
      gmtCreate?: string(name='GmtCreate', description='The time when the task was created.', example='2022-05-20T08:23:22Z'),
      gmtModified?: string(name='GmtModified', description='The time when the task was modified.', example='2022-05-21T08:23:22Z'),
      mediaId?: string(name='MediaId', description='The ID of the media file.', example='ca3a8f6e4957b658067095869****'),
      mediaRefreshJobId?: string(name='MediaRefreshJobId', description='The ID of the job.', example='41d465e31957****'),
      status?: string(name='Status', description='The status of the job. Valid values:

*   **success**
*   **fail**', example='success'),
      successPlayUrls?: string(name='SuccessPlayUrls', description='The playback URLs that were refreshed or prefetched.', example='https://shenzhen.****.aliyuncdn.com/74401a4f546007bf845cd8840****.m3u8,https://shenzhen.****.aliyuncdn.com/24041e7d13582d86604d8****.m3u8'),
      taskIds?: string(name='TaskIds', description='The IDs of the refresh or prefetch tasks for the playback URLs of media files. Only one URL can be refreshed or prefetched in a task. This value is used in the [DescribeVodRefreshTasks](~~DescribeVodRefreshTasks~~) operation, which queries the status of refresh or prefetch tasks for playback URLs of media files.', example='70422****,9524****'),
      taskType?: string(name='TaskType', description='The type of the job. Valid values:

*   **Refresh**
*   **Preload**', example='Preload'),
      userData?: string(name='UserData', description='The user data that you passed when you submit a refresh or prefetch task.', example='{"MessageCallback":{"CallbackURL":"http://example.aliyundoc.com"}, "Extend":{"localId":"xxx","test":"www"}}'),
    }
  ](name='MediaRefreshJobs', description='The media refresh or prefetch jobs.'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='25818875-5F78-4AF6-D7393642CA58****'),
}

model GetMediaRefreshJobsResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: GetMediaRefreshJobsResponseBody(name='body'),
}

/**
 * @summary Queries the information about media refresh or prefetch jobs, such as the job status and filtering conditions.
 *
 * @description You can query the information about all media files or a specific media file in a refresh or prefetch job.
 * ### QPS limits
 * You can call this operation up to 50 times per second per account. Requests that exceed this limit are dropped and you will experience service interruptions. We recommend that you take note of this limit when you call this operation. For more information, see [QPS limits on API operations in ApsaraVideo VoD](https://help.aliyun.com/document_detail/342790.html).
 *
 * @param request GetMediaRefreshJobsRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return GetMediaRefreshJobsResponse
 */
async function getMediaRefreshJobsWithOptions(request: GetMediaRefreshJobsRequest, runtime: $RuntimeOptions): GetMediaRefreshJobsResponse {
  request.validate();
  var query = OpenApiUtil.query(request.toMap());
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'GetMediaRefreshJobs',
    version = '2017-03-21',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'GET',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Queries the information about media refresh or prefetch jobs, such as the job status and filtering conditions.
 *
 * @description You can query the information about all media files or a specific media file in a refresh or prefetch job.
 * ### QPS limits
 * You can call this operation up to 50 times per second per account. Requests that exceed this limit are dropped and you will experience service interruptions. We recommend that you take note of this limit when you call this operation. For more information, see [QPS limits on API operations in ApsaraVideo VoD](https://help.aliyun.com/document_detail/342790.html).
 *
 * @param request GetMediaRefreshJobsRequest
 * @return GetMediaRefreshJobsResponse
 */
async function getMediaRefreshJobs(request: GetMediaRefreshJobsRequest): GetMediaRefreshJobsResponse {
  var runtime = new $RuntimeOptions{};
  return getMediaRefreshJobsWithOptions(request, runtime);
}

model GetMessageCallbackRequest {
  appId?: string(name='AppId', description='The ID of the application. If you do not set this parameter, the default value **app-1000000** is used.', example='app-1000000'),
  ownerAccount?: string(name='OwnerAccount'),
}

model GetMessageCallbackResponseBody = {
  messageCallback?: {
    appId?: string(name='AppId', description='The ID of the application.', example='app-1000000'),
    authKey?: string(name='AuthKey', description='The cryptographic key. This parameter is returned only for HTTP callbacks.', example='12345678abc'),
    authSwitch?: string(name='AuthSwitch', description='Indicates whether callback authentication is enabled. This parameter is returned only for HTTP callbacks. Valid values:

*   **on**
*   **off**', example='on'),
    callbackType?: string(name='CallbackType', description='The callback method. Valid values:

*   **HTTP**
*   **MNS**', example='HTTP'),
    callbackURL?: string(name='CallbackURL', description='The callback URL. This parameter is returned only for HTTP callbacks.', example='http://test.com/test'),
    eventTypeList?: string(name='EventTypeList', description='The type of the callback event.', example='FileUploadComplete,StreamTranscodeComplete,TranscodeComplete,SnapshotComplete,AIComplete,AddLiveRecordVideoComplete,CreateAuditComplete,UploadByURLComplete,ProduceMediaComplete,LiveRecordVideoComposeStart,ImageUploadComplete,VideoAnalysisComplete'),
    mnsEndpoint?: string(name='MnsEndpoint', description='The public endpoint of MNS. This parameter is returned only for MNS callbacks.', example='http://1234567.mns.cn-shanghai-internal.aliyuncs.com/'),
    mnsQueueName?: string(name='MnsQueueName', description='The name of the Message Service (MNS) queue. This parameter is returned only for MNS callbacks.', example='vodcallback'),
  }(name='MessageCallback', description='The configuration of the event notification.'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='272A222A-F7F7-4A3E-****-F531574F1234'),
}

model GetMessageCallbackResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: GetMessageCallbackResponseBody(name='body'),
}

/**
 * @summary Queries the callback method, callback URL, and event type for event notifications.
 *
 * @description > For more information, see [Event notification](https://help.aliyun.com/document_detail/55627.html).
 *
 * @param request GetMessageCallbackRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return GetMessageCallbackResponse
 */
async function getMessageCallbackWithOptions(request: GetMessageCallbackRequest, runtime: $RuntimeOptions): GetMessageCallbackResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.appId)) {
    query['AppId'] = request.appId;
  }
  if (!$isNull(request.ownerAccount)) {
    query['OwnerAccount'] = request.ownerAccount;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'GetMessageCallback',
    version = '2017-03-21',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Queries the callback method, callback URL, and event type for event notifications.
 *
 * @description > For more information, see [Event notification](https://help.aliyun.com/document_detail/55627.html).
 *
 * @param request GetMessageCallbackRequest
 * @return GetMessageCallbackResponse
 */
async function getMessageCallback(request: GetMessageCallbackRequest): GetMessageCallbackResponse {
  var runtime = new $RuntimeOptions{};
  return getMessageCallbackWithOptions(request, runtime);
}

model GetMezzanineInfoRequest {
  additionType?: string(name='AdditionType', description='The type of additional information. Separate multiple values with commas (,). By default, only the basic information is returned. Valid values:

*   **video**: video stream information
*   **audio**: audio stream information', example='video'),
  authTimeout?: long(name='AuthTimeout', description='The validity period of the mezzanine file URL. Unit: seconds. Default value: **1800**. Minimum value: **1**.

*   If the OutputType parameter is set to **cdn**:

    *   The mezzanine file URL has a validity period only if URL signing is enabled. Otherwise, the mezzanine file URL is permanently valid.
    *   Minimum value: **1**.
    *   Maximum Value: unlimited.
    *   Default value: If you do not set this parameter, the default validity period that is specified in URL signing is used.

<!---->

*   If the OutputType parameter is set to **oss**:

    *   The mezzanine file URL has a validity period only if the permissions on the Object Storage Service (OSS) bucket are private. Otherwise, the mezzanine file URL is permanently valid.
    *   Minimum value: **1**.
    *   Maximum value: **2592000** (30 days). The maximum value is limited to reduce security risks of the origin.
    *   Default value: If you do not set this parameter, the default value is **3600**.', example='3600'),
  outputType?: string(name='OutputType', description='The type of the mezzanine file URL. Valid values:

- **oss**: OSS URL
- **cdn** (default): Content Delivery Network (CDN) URL

> If the mezzanine file is stored in a bucket of the in type, only an OSS URL is returned.', example='oss'),
  videoId?: string(name='VideoId', description='The ID of the video.

This parameter is required.', example='1f1a6fc03ca04814031b8a6559e****'),
}

model GetMezzanineInfoResponseBody = {
  mezzanine?: {
    audioStreamList?: [ 
      {
        bitrate?: string(name='Bitrate', description='The bitrate.', example='62.885'),
        channelLayout?: string(name='ChannelLayout', description='The output layout of the sound channels. Valid values:

*   **mono**
*   **stereo**', example='mono'),
        channels?: string(name='Channels', description='The number of sound channels.', example='1'),
        codecLongName?: string(name='CodecLongName', description='The full name of the encoding format.', example='AAC (Advanced Audio Coding)'),
        codecName?: string(name='CodecName', description='The short name of the encoding format.', example='aac'),
        codecTag?: string(name='CodecTag', description='The tag of the encoding format.', example='0x6134706d'),
        codecTagString?: string(name='CodecTagString', description='The tag string of the encoding format.', example='mp4a'),
        codecTimeBase?: string(name='CodecTimeBase', description='The codec time base.', example='1/44100'),
        duration?: string(name='Duration', description='The duration of the audio file.', example='3.227574'),
        index?: string(name='Index', description='The sequence number of the audio stream. The value indicates the position of the audio stream in all audio streams.', example='0'),
        lang?: string(name='Lang', description='The language.', example='und'),
        numFrames?: string(name='NumFrames', description='The total number of frames.', example='1'),
        sampleFmt?: string(name='SampleFmt', description='The sampling format.', example='fltp'),
        sampleRate?: string(name='SampleRate', description='The sampling rate of the audio stream.', example='44100'),
        startTime?: string(name='StartTime', description='The beginning of the time range during which the data was queried. The time follows the ISO 8601 standard in the *yyyy-MM-dd*T*HH:mm:ss*Z format. The time is displayed in UTC.', example='2017-01-11T12:00:00Z'),
        timebase?: string(name='Timebase', description='The time base of the audio stream.', example='0.000000'),
      }
    ](name='AudioStreamList', description='The codec time base.'),
    bitrate?: string(name='Bitrate', description='The bitrate of the file. Unit: Kbit/s.', example='771.2280'),
    creationTime?: string(name='CreationTime', description='The time when the file was created. The time follows the ISO 8601 standard in the *yyyy-MM-dd*T*HH:mm:ss*Z format. The time is displayed in UTC.', example='2017-11-14T09:15:50Z'),
    duration?: string(name='Duration', description='The duration of the file. Unit: seconds.', example='42.4930'),
    fileName?: string(name='FileName', description='The name of the file.', example='27ffc438-164h67f57ef-0005-6884-51a-1****.mp4'),
    fileURL?: string(name='FileURL', description='The URL of the file.', example='http://example-bucket-****.oss-cn-shanghai.aliyuncs.com/27ffc438-164h67f57ef-0005-6884-51a-1****.mp4'),
    fps?: string(name='Fps', description='The frame rate of the file. Unit: frames per second.', example='25.0000'),
    height?: long(name='Height', description='The height of the file. Unit: pixel.', example='540'),
    outputType?: string(name='OutputType', description='The type of the mezzanine file URL. Valid values:

- **oss**: OSS URL
- **cdn** (default): CDN URL

> If you specify an OSS URL for the video stream, the video stream must be in the MP4 format.', example='oss'),
    preprocessStatus?: string(name='PreprocessStatus', description='The preprocess status od the media.', example='UnPreprocess'),
    restoreExpiration?: string(name='RestoreExpiration', description='The period of time in which the object remains in the restored state.', example='2023-03-30T10:14:14Z'),
    restoreStatus?: string(name='RestoreStatus', description='The restoration status of the audio or video file. Valid values:

*   **Processing**
*   **Success**
*   **Failed**', example='Success'),
    size?: long(name='Size', description='The size of the file. Unit: byte.', example='4096477'),
    status?: string(name='Status', description='The status of the file. Valid values:

*   **Uploading**: The file is being uploaded. This is the initial status.
*   **Normal**: The file is uploaded.
*   **UploadFail**: The file fails to be uploaded.
*   **Deleted**: The file is deleted.', example='Normal'),
    storageClass?: string(name='StorageClass', description='The storage class of the audio file. Valid values:

*   **Standard**: All media resources are stored as Standard objects.
*   **IA**: All media resources are stored as IA objects.
*   **Archive**: All media resources are stored as Archive objects.
*   **ColdArchive**: All media resources are stored as Cold Archive objects.
*   **SourceIA**: Only the source files are IA objects.
*   **SourceArchive**: Only the source files are Archive objects.
*   **SourceColdArchive**: Only the source files are Cold Archive objects.
*   **Changing**: The storage class of the audio file is being changed.
*   **SourceChanging**: The storage class of the source file is being changed.', example='Standard'),
    videoId?: string(name='VideoId', description='The ID of the video.', example='1f1a6fc03ca04814031b8a6559e****'),
    videoStreamList?: [ 
      {
        avgFPS?: string(name='AvgFPS', description='The average frame rate.', example='30.0'),
        bitrate?: string(name='Bitrate', description='The bitrate. Unit: Kbit/s.', example='500'),
        codecLongName?: string(name='CodecLongName', description='The full name of the encoding format.', example='H.264 / AVC / MPEG-4 AVC / MPEG-4 part 10'),
        codecName?: string(name='CodecName', description='The short name of the encoding format.', example='h264'),
        codecTag?: string(name='CodecTag', description='The tag of the encoding format.', example='0x31637661'),
        codecTagString?: string(name='CodecTagString', description='The tag string of the encoding format.', example='avc1'),
        codecTimeBase?: string(name='CodecTimeBase', description='The codec time base.', example='1/60'),
        dar?: string(name='Dar', description='The display aspect ratio (DAR) of the video stream.', example='0:1'),
        duration?: string(name='Duration', description='The duration of the audio file.', example='3.166667'),
        fps?: string(name='Fps', description='The frame rate of the output file.', example='30.0'),
        HDRType?: string(name='HDRType', description='The HDR type of the video stream.', example='HDR'),
        hasBFrames?: string(name='HasBFrames', description='Indicates whether the video stream contains B-frames.', example='0'),
        height?: string(name='Height', description='The height of the video stream.', example='320'),
        index?: string(name='Index', description='The sequence number of the video stream. The value indicates the position of the video stream in all video streams.', example='1'),
        lang?: string(name='Lang', description='The language.', example='und'),
        level?: string(name='Level', description='The codec level.', example='30'),
        numFrames?: string(name='NumFrames', description='The total number of frames.', example='0'),
        pixFmt?: string(name='PixFmt', description='The pixel format.', example='yuv420p'),
        profile?: string(name='Profile', description='The codec profile.', example='Main'),
        rotate?: string(name='Rotate', description='The rotation angle of the video. Valid values: **[0,360)**.', example='90'),
        sar?: string(name='Sar', description='The sample aspect ratio (SAR) of the video stream.', example='0:1'),
        startTime?: string(name='StartTime', description='The beginning of the time range during which the data was queried. The time follows the ISO 8601 standard in the *yyyy-MM-dd*T*HH:mm:ss*Z format. The time is displayed in UTC.', example='2017-01-11T12:00:00Z'),
        timebase?: string(name='Timebase', description='The time base of the audio stream.', example='0.000000'),
        width?: string(name='Width', description='The width of the video in pixels.', example='568'),
      }
    ](name='VideoStreamList', description='The HDR type of the video stream.'),
    width?: long(name='Width', description='The width of the file. Unit: pixel.', example='960'),
  }(name='Mezzanine', description='The information about the source file.'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='25818875-5F78-4AF6-D7393642CA58****'),
}

model GetMezzanineInfoResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: GetMezzanineInfoResponseBody(name='body'),
}

/**
 * @summary Queries the information about the mezzanine file of an audio or video. The information includes the mezzanine file URL, resolution, and bitrate of the audio or video.
 *
 * @description You can obtain complete information about the source file only after a stream is transcoded.
 *
 * @param request GetMezzanineInfoRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return GetMezzanineInfoResponse
 */
async function getMezzanineInfoWithOptions(request: GetMezzanineInfoRequest, runtime: $RuntimeOptions): GetMezzanineInfoResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.additionType)) {
    query['AdditionType'] = request.additionType;
  }
  if (!$isNull(request.authTimeout)) {
    query['AuthTimeout'] = request.authTimeout;
  }
  if (!$isNull(request.outputType)) {
    query['OutputType'] = request.outputType;
  }
  if (!$isNull(request.videoId)) {
    query['VideoId'] = request.videoId;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'GetMezzanineInfo',
    version = '2017-03-21',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Queries the information about the mezzanine file of an audio or video. The information includes the mezzanine file URL, resolution, and bitrate of the audio or video.
 *
 * @description You can obtain complete information about the source file only after a stream is transcoded.
 *
 * @param request GetMezzanineInfoRequest
 * @return GetMezzanineInfoResponse
 */
async function getMezzanineInfo(request: GetMezzanineInfoRequest): GetMezzanineInfoResponse {
  var runtime = new $RuntimeOptions{};
  return getMezzanineInfoWithOptions(request, runtime);
}

model GetPlayInfoRequest {
  additionType?: string(name='AdditionType', description='The URL of the masked live comment data. Value: **danmu**.

>  This parameter takes effect only when the `outputType` parameter is set to `cdn`.', example='danmu'),
  authTimeout?: long(name='AuthTimeout', description='The validity period of the playback URL. Unit: seconds.

*   If you set OutputType to **cdn**:

    *   The playback URL has a validity period only if URL signing is enabled. Otherwise, the playback URL is permanently valid. For more information about how to enable and configure URL signing, see [URL signing](https://help.aliyun.com/document_detail/86090.html).
    *   Minimum value: **1**.
    *   Maximum value: unlimited.
    *   Default value: The default validity period that is specified in URL signing is used.

*   If you set OutputType to **oss**:

    *   This parameter takes effect only when the ACL of the Object Storage Service (OSS) bucket is private. Otherwise, the playback URL does not expire.
    *   Minimum value: **1**.
    *   Maximum value: If the media file is stored in the VOD bucket, the maximum validity period is **2592000** (30 days). If the media file is stored in an OSS bucket, the maximum validity period is **129600** (36 hours). This limit is imposed to reduce security risks of the origin server. If you require a longer validity period, set OutputType to **cdn** and configure URL signing to specify a longer validity period.
    *   Default value: **3600**.', example='1800'),
  definition?: string(name='Definition', description='The quality of the video stream. Separate multiple qualities with commas (,). Valid values:

*   **FD**: low definition
*   **LD**: standard definition
*   **SD**: high definition
*   **HD**: ultra-high definition
*   **OD**: original definition
*   **2K**
*   **4K**
*   **SQ**: standard sound quality
*   **HQ**: high sound quality
*   **AUTO**: adaptive bitrate

> *   By default, ApsaraVideo VOD returns video streams in all the preceding qualities.
> *   However, video streams for adaptive bitrate streaming are returned only if the PackageSetting parameter is specified in the transcoding template. For more information, see the [PackageSetting parameter in the TranscodeTemplate table](~~52839#title-4fk-cg8-gzx~~).', example='LD'),
  digitalWatermarkType?: string(name='DigitalWatermarkType', description='The type of the digital watermark. Valid values:

*   TraceMark: tracing watermark
*   CopyrightMark: copyright watermark', example='TraceMark'),
  formats?: string(name='Formats', description='The format of the media stream. Separate multiple formats with commas (,). Valid values:

*   **mp4**
*   **m3u8**
*   **mp3**
*   **flv**
*   **mpd**

> *   By default, ApsaraVideo VOD returns video streams in all the preceding formats.
>*   However, video streams in the MPD format are returned only if the `dash` container format is specified in the transcoding template. For more information, see the [Container parameter in the TranscodeTemplate table](~~52839#title-7rr-3hj-gy5~~).', example='mp4,m3u8'),
  outputType?: string(name='OutputType', description='The type of the output URL. Default value: oss. Valid values:

*   **oss**
*   **cdn**', example='cdn'),
  playConfig?: string(name='PlayConfig', description='The custom playback configuration. The value must be a JSON string. You can specify a domain name for playback. For more information, see [PlayConfig](~~86952#section-9g7-s9b-v7z~~).

> *   If you do not set the PlayConfig parameter or the `PlayDomain` parameter that is nested under the PlayConfig parameter, the default domain name specified in ApsaraVideo VOD is used in this operation. If no default domain name is specified, the domain names are queried in reverse chronological order based on the time when the domain names were last modified. To prevent domain name issues, we recommend that you perform the following steps to specify the default playback domain name: Log on to the [ApsaraVideo VOD console](https://vod.console.aliyun.com). In the left-side navigation pane, choose **Configuration Management** > **Media Management** > **Storage**. Find the domain name that you want to configure and click **Manage** in the Actions column. On the page that appears, set the default playback domain name in the **Origin Domain Name** section.
> *   If you set the `EncryptType` parameter nested under the PlayConfig parameter to `AliyunVoDEncryption`, the playback URLs of videos encrypted by using Alibaba Cloud proprietary cryptography are not automatically returned to ensure video security. To return playback URLs of videos encrypted by using Alibaba Cloud proprietary cryptography, you must set the `ResultType` parameter to `Multiple`.', example='{"PlayDomain":"vod.test_domain","XForwardedFor":"yqCD7Fp1uqChoVj/sl/p5Q==","PreviewTime":"20","MtsHlsUriToken":"yqCD7Fp1uqChoVjslp5Q"}'),
  reAuthInfo?: string(name='ReAuthInfo', description='The CDN reauthentication configuration. The value must be a JSON string. If CDN reauthentication is enabled, you can use this parameter to specify the `UID` and `rand` fields for URL authentication. For more information, see [URL authentication](https://help.aliyun.com/document_detail/2249352.html).', example='{"uid":"12345","rand":"abckljd"}'),
  resultType?: string(name='ResultType', description='The type of the data to return. Default value: Single. Valid values:

*   **Single**: Only one latest transcoded stream is returned for each quality and format.
*   **Multiple**: All transcoded streams are returned for each quality and format.', example='Single'),
  streamType?: string(name='StreamType', description='The type of the media stream. Separate multiple types with commas (,). Valid values:

*   **video**
*   **audio**

By default, video and audio streams are returned.', example='video'),
  trace?: string(name='Trace', description='The custom digital watermark.

*   If you set `DigitalWatermarkType` to `TraceMark`, specify this parameter to configure the video tracing watermark and return the video stream that contains the watermark. The value can be up to 1,024 characters in length and can contain letters and digits.
*   If you set `DigitalWatermarkType` to `CopyrightMark`, specify the **watermark text** that you created for the watermark template for this parameter.`` You can specify this parameter to query and return the video stream that contains the specified watermark text.', example='test mark'),
  videoId?: string(name='VideoId', description='The ID of the media file. You can specify only one ID. You can use one of the following methods to obtain the ID:

*   Log on to the [ApsaraVideo VOD console](https://vod.console.aliyun.com). In the left-side navigation pane, choose **Media Files** > **Audio/Video**. On the page that appears, view the media ID.
*   Obtain the value of the VideoId parameter in the response to the [CreateUploadVideo](https://help.aliyun.com/document_detail/55407.html) operation that you called to upload the audio or video file.
*   Obtain the value of VideoId by calling the [SearchMedia](https://help.aliyun.com/document_detail/86044.html) operation. This method is applicable to files that have been uploaded.

This parameter is required.', example='93ab850b4f654b6e91d24d81d44****'),
}

model GetPlayInfoResponseBody = {
  playInfoList?: {
    playInfo?: [ 
    {
      bitDepth?: int32(name='BitDepth', description='The color depth. This value is an integer.', example='8'),
      bitrate?: string(name='Bitrate', description='The bitrate of the media stream. Unit: Kbit/s.', example='450.878'),
      codecName?: string(name='CodecName', description='The encoding type. The possible values are:

- H264

- H265', example='H264'),
      creationTime?: string(name='CreationTime', description='The time when the audio or video stream was created. The time is in the *yyyy-MM-dd*T*HH:mm:ss*Z format. The time is displayed in UTC.', example='2022-04-18T07:37:15Z'),
      definition?: string(name='Definition', description='The quality of the video stream. Valid values:

*   **FD**: low definition
*   **LD**: standard definition
*   **SD**: high definition
*   **HD**: ultra-high definition
*   **OD**: original definition
*   **2K**
*   **4K**
*   **SQ**: standard sound quality
*   **HQ**: high sound quality
*   **AUTO**: adaptive bitrate', example='LD'),
      duration?: string(name='Duration', description='The duration of the media stream. Unit: seconds.', example='9.0464'),
      encrypt?: long(name='Encrypt', description='Indicates whether the media stream is encrypted. Valid values:

*   **0**: The media stream is not encrypted.
*   **1**: The media stream is encrypted.', example='1'),
      encryptMode?: string(name='EncryptMode', description='The encryption type of the media stream. Valid values:

*   **License**: decryption on local devices

>  If the encryption type is **License**, only ApsaraVideo Player SDK can be used to play videos.', example='License'),
      encryptType?: string(name='EncryptType', description='The encryption type of the media stream. Valid values:

*   **AliyunVoDEncryption**: Alibaba Cloud proprietary cryptography
*   **HLSEncryption**: HTTP-Live-Streaming (HLS) encryption

>  If the encryption type is AliyunVoDEncryption, only ApsaraVideo Player SDK can be used to play videos.', example='AliyunVoDEncryption'),
      format?: string(name='Format', description='The format of the media stream.

*   If the media file is a video file, the valid values are **mp4** and **m3u8**.
*   If the media asset is an audio-only file, the value is **mp3**.', example='m3u8'),
      fps?: string(name='Fps', description='The frame rate of the media stream. Unit: frames per second.', example='25'),
      HDRType?: string(name='HDRType', description='The HDR type of the media stream. Valid values:

*   HDR
*   HDR10
*   HLG
*   DolbyVision
*   HDRVivid
*   SDR+', example='HLG'),
      height?: long(name='Height', description='The height of the media stream. Unit: pixels.', example='640'),
      jobExt?: string(name='JobExt', description='The custom watermark information of the copyright watermark. This parameter is returned if you set `JobType` to `2`.', example='CopyrightMarkTest'),
      jobId?: string(name='JobId', description='The job ID for transcoding the media stream. This ID uniquely identifies a media stream.', example='80e9c6580e754a798c3c19c59b16****'),
      jobType?: int32(name='JobType', description='The type of the digital watermark. Valid values:

*   **1**: user-tracing watermark
*   **2**: copyright watermark', example='2'),
      modificationTime?: string(name='ModificationTime', description='The time when the audio or video file was last updated. The time is in the *yyyy-MM-dd*T*HH:mm:ss*Z format. The time is displayed in UTC.', example='2022-04-20T06:32:19Z'),
      narrowBandType?: string(name='NarrowBandType', description='The transcoding type. Valid values:

*   **0**: regular transcoding
*   **1.0**: Narrowband HD™ 1.0 transcoding
*   **2.0**: Narrowband HD™ 2.0 transcoding', example='0'),
      playURL?: string(name='PlayURL', description='The playback URL of the video stream.'),
      size?: long(name='Size', description='The size of the media stream. Unit: bytes.', example='418112'),
      specification?: string(name='Specification', description='The specifications of transcoded audio and video streams. For more information about the valid values, see [Output specifications](~~124671#section-6bv-l0g-opq~~).', example='H264.LD'),
      status?: string(name='Status', description='The status of the audio or video stream. Valid values:

*   **Normal**: The latest transcoded stream in each quality and format is in the Normal status.
*   **Invisible**: If multiple streams are transcoded in the same quality and format, the latest transcoded stream is in the Normal status and other streams are in the Invisible status.', example='Normal'),
      streamType?: string(name='StreamType', description='The type of the media stream. If the media stream is a video stream, the value is **video**. If the media stream is an audio-only stream, the value is **audio**.', example='video'),
      watermarkId?: string(name='WatermarkId', description='The ID of the watermark that is associated with the media stream.', example='dgfn26457856****'),
      width?: long(name='Width', description='The width of the media stream. Unit: pixels.', example='360'),
    }
  ](name='PlayInfo')
  }(name='PlayInfoList', description='The information about the audio or video stream.'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='F552E596-967D-5500-842F-17E6364****'),
  videoBase?: {
    coverURL?: string(name='CoverURL', description='The thumbnail URL of the audio or video file.', example='http://example.aliyundoc.com/sample.jpg?auth_key=2333232-atb****'),
    creationTime?: string(name='CreationTime', description='The time when the audio or video file was created. The time follows the ISO 8601 standard in the *yyyy-MM-dd*T*HH:mm:ss*Z format. The time is displayed in UTC.', example='2017-06-26T06:38:48Z'),
    danMuURL?: string(name='DanMuURL', description='The URL of the masked live comment data.', example='http://example.aliyundoc.com/****?auth_key=abdf2123-6783232****'),
    duration?: string(name='Duration', description='The duration of the audio or video file. Unit: seconds.', example='3.1667'),
    mediaType?: string(name='MediaType', description='The type of the media file. Valid values:

*   **video**
*   **audio**', example='video'),
    status?: string(name='Status', description='The status of the media file. For more information about the value range and description, see the [Status](~~52839#title-vqg-8cz-7p8~~) table.', example='Normal'),
    storageClass?: string(name='StorageClass', description='The storage class of the audio file. Valid values:

*   **Standard**: All media resources are stored as Standard objects.
*   **IA**: All media resources are stored as IA objects.
*   **Archive**: All media resources are stored as Archive objects.
*   **ColdArchive**: All media resources are stored as Cold Archive objects.
*   **SourceIA**: Only the source files are IA objects.
*   **SourceArchive**: Only the source files are Archive objects.
*   **SourceColdArchive**: Only the source file is stored as a Cold Archive object.
*   **Changing**: The storage class of the video file is being changed.
*   **SourceChanging**: The storage class of the source file is being changed.', example='Standard'),
    title?: string(name='Title', description='The title of the audio or video file.', example='ApsaraVideo VOD'),
    videoId?: string(name='VideoId', description='The ID of the media file.', example='93ab850b4f654b6e91d24d81d44****'),
  }(name='VideoBase', description='The basic information about the audio or video file.'),
}

model GetPlayInfoResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: GetPlayInfoResponseBody(name='body'),
}

/**
 * @summary Obtains the playback URL by the audio or video ID. Then, you can use ApsaraVideo Player or a third-party player, such as a system player, open source player, orself-developed player, to play the audio or video.
 *
 * @description *   **Make sure that you understand the billing method and price of ApsaraVideo VOD before you call this operation. You are charged for outbound traffic when you download or play videos based on URLs in ApsaraVideo VOD. For more information about billing of outbound traffic, see [Billing of outbound traffic](~~188308#section-rwh-e88-f7j~~). If you have configured an accelerated domain name, see [Billing of the acceleration service](~~188308#section-c5t-oq9-15e~~). If you have activated the acceleration service, you are charged acceleration fees when you upload media files to ApsaraVideo VOD. For more information, see [Billing of acceleration traffic](~~188310#section_sta_zm2_tsv~~).**
 * *   Only videos whose Status is Normal can be played. For more information, see [Overview](https://help.aliyun.com/document_detail/57290.html).
 * *   If video playback fails, you can call the [GetMezzanineInfo](~~GetMezzanineInfo~~) operation to check whether the video source information is correct.
 *
 * @param request GetPlayInfoRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return GetPlayInfoResponse
 */
async function getPlayInfoWithOptions(request: GetPlayInfoRequest, runtime: $RuntimeOptions): GetPlayInfoResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.additionType)) {
    query['AdditionType'] = request.additionType;
  }
  if (!$isNull(request.authTimeout)) {
    query['AuthTimeout'] = request.authTimeout;
  }
  if (!$isNull(request.definition)) {
    query['Definition'] = request.definition;
  }
  if (!$isNull(request.digitalWatermarkType)) {
    query['DigitalWatermarkType'] = request.digitalWatermarkType;
  }
  if (!$isNull(request.formats)) {
    query['Formats'] = request.formats;
  }
  if (!$isNull(request.outputType)) {
    query['OutputType'] = request.outputType;
  }
  if (!$isNull(request.playConfig)) {
    query['PlayConfig'] = request.playConfig;
  }
  if (!$isNull(request.reAuthInfo)) {
    query['ReAuthInfo'] = request.reAuthInfo;
  }
  if (!$isNull(request.resultType)) {
    query['ResultType'] = request.resultType;
  }
  if (!$isNull(request.streamType)) {
    query['StreamType'] = request.streamType;
  }
  if (!$isNull(request.trace)) {
    query['Trace'] = request.trace;
  }
  if (!$isNull(request.videoId)) {
    query['VideoId'] = request.videoId;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'GetPlayInfo',
    version = '2017-03-21',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Obtains the playback URL by the audio or video ID. Then, you can use ApsaraVideo Player or a third-party player, such as a system player, open source player, orself-developed player, to play the audio or video.
 *
 * @description *   **Make sure that you understand the billing method and price of ApsaraVideo VOD before you call this operation. You are charged for outbound traffic when you download or play videos based on URLs in ApsaraVideo VOD. For more information about billing of outbound traffic, see [Billing of outbound traffic](~~188308#section-rwh-e88-f7j~~). If you have configured an accelerated domain name, see [Billing of the acceleration service](~~188308#section-c5t-oq9-15e~~). If you have activated the acceleration service, you are charged acceleration fees when you upload media files to ApsaraVideo VOD. For more information, see [Billing of acceleration traffic](~~188310#section_sta_zm2_tsv~~).**
 * *   Only videos whose Status is Normal can be played. For more information, see [Overview](https://help.aliyun.com/document_detail/57290.html).
 * *   If video playback fails, you can call the [GetMezzanineInfo](~~GetMezzanineInfo~~) operation to check whether the video source information is correct.
 *
 * @param request GetPlayInfoRequest
 * @return GetPlayInfoResponse
 */
async function getPlayInfo(request: GetPlayInfoRequest): GetPlayInfoResponse {
  var runtime = new $RuntimeOptions{};
  return getPlayInfoWithOptions(request, runtime);
}

model GetTranscodeSummaryRequest {
  videoIds?: string(name='VideoIds', description='The ID of the audio or video file. You can specify up to 10 IDs. Separate the IDs with commas (,). You can use one of the following methods to obtain the ID:

*   After you upload a video in the [ApsaraVideo VOD console](https://vod.console.aliyun.com), you can log on to the ApsaraVideo VOD console and choose **Media Files** > **Audio/Video** to view the ID of the video.
*   Obtain the value of VideoId from the response to the [CreateUploadVideo](https://help.aliyun.com/document_detail/55407.html) operation that you call to obtain the upload URL and credential.
*   Obtain the value of VideoId by calling the [SearchMedia](https://help.aliyun.com/document_detail/86044.html) operation. This method is applicable to files that have been uploaded.

This parameter is required.', example='"d4860fcc6ae9fed52e8938244****,e1db68cc586644b83e562bcd94****,hhhhhhh"'),
}

model GetTranscodeSummaryResponseBody = {
  nonExistVideoIds?: [ string ](name='NonExistVideoIds', description='The IDs of the audio or video files that do not exist.'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='25818875-5F78-4A*****F6-D7393642CA58'),
  transcodeSummaryList?: [ 
    {
      completeTime?: string(name='CompleteTime', description='The time when the transcoding task was complete. The time is in the *yyyy-MM-dd*T*HH:mm:ss*Z format. The time is displayed in UTC.', example='2019-01-23T12:40:12Z'),
      creationTime?: string(name='CreationTime', description='The time when the transcoding task was created. The time is in the *yyyy-MM-dd*T*HH:mm:ss*Z format. The time is displayed in UTC.', example='2019-01-23T12:35:12Z'),
      transcodeJobInfoSummaryList?: [ 
        {
          bitrate?: string(name='Bitrate', description='The average bitrate of the output video. Unit: Kbit/s.', example='749'),
          completeTime?: string(name='CompleteTime', description='The time when the transcoding job was complete. The time is in the *yyyy-MM-dd*T*HH:mm:ss*Z format. The time is displayed in UTC.', example='2019-02-27T03:40:51Z'),
          creationTime?: string(name='CreationTime', description='The time when the transcoding job was created. The time is in the *yyyy-MM-dd*T*HH:mm:ss*Z format. The time is displayed in UTC.', example='2019-02-27T03:34:46Z'),
          duration?: string(name='Duration', description='The duration of the output video. Unit: seconds.', example='12'),
          errorCode?: string(name='ErrorCode', description='The error code returned when the transcoding job failed.', example='200'),
          errorMessage?: string(name='ErrorMessage', description='The error message returned when the transcoding job failed.', example='ErrorMessage'),
          filesize?: long(name='Filesize', description='The size of the output video. Unit: bytes.', example='1144259'),
          format?: string(name='Format', description='The container format of the output video.', example='mp4'),
          fps?: string(name='Fps', description='The frame rate of the output video. Unit: frames per second.', example='30'),
          height?: string(name='Height', description='The height of the output video. Unit: pixels.', example='960'),
          transcodeJobStatus?: string(name='TranscodeJobStatus', description='The status of the transcoding job. Valid values:

*   **Transcoding**: Transcoding is in process.
*   **TranscodeSuccess**: The job was successful.
*   **TranscodeFail**: The job failed.', example='Transcoding'),
          transcodeProgress?: long(name='TranscodeProgress', description='The transcoding progress. Valid values: `[0,100]`.', example='100'),
          transcodeTemplateId?: string(name='TranscodeTemplateId', description='The ID of the transcoding template.', example='57496724ae2*****0968d6e08acc8f6'),
          watermarkIdList?: [ string ](name='WatermarkIdList', description='The IDs of the watermarks that are applied to the output video.'),
          width?: string(name='Width', description='The width of the output video. Unit: pixels.', example='544'),
        }
      ](name='TranscodeJobInfoSummaryList', description='The summaries of transcoding jobs.'),
      transcodeStatus?: string(name='TranscodeStatus', description='The status of the transcoding task. Valid values:

*   **Processing**: Transcoding is in process.
*   **Partial**: Some transcoding jobs were complete.
*   **CompleteAllSucc**: All transcoding jobs were successful.
*   **CompleteAllFail**: All transcoding jobs failed. If an exception occurs in the source file, no transcoding job is initiated and the transcoding task fails.
*   **CompletePartialSucc**: All transcoding jobs were complete but only some were successful.', example='Processing'),
      transcodeTemplateGroupId?: string(name='TranscodeTemplateGroupId', description='The ID of the transcoding template group.', example='44f9e406bbb*****736a9abe876ecc0'),
      videoId?: string(name='VideoId', description='The ID of the audio or video file.', example='e1db68cc586644b83e562bcd94****'),
    }
  ](name='TranscodeSummaryList', description='The transcoding summary of the file.'),
}

model GetTranscodeSummaryResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: GetTranscodeSummaryResponseBody(name='body'),
}

/**
 * @summary Queries transcoding summaries of audio and video files based on the file ID. A transcoding summary includes the status and progress of transcoding.
 *
 * @description *   An audio or video file may be transcoded multiple times. This operation returns only the latest transcoding summary.
 * *   You can query transcoding summaries for a maximum of 10 audio and video files in one request.
 * *   You can call the [ListTranscodeTask](https://help.aliyun.com/document_detail/109120.html) operation to query historical transcoding tasks.
 * *   **You can call this operation to query information only about transcoding tasks created within the past year.
 *
 * @param request GetTranscodeSummaryRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return GetTranscodeSummaryResponse
 */
async function getTranscodeSummaryWithOptions(request: GetTranscodeSummaryRequest, runtime: $RuntimeOptions): GetTranscodeSummaryResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.videoIds)) {
    query['VideoIds'] = request.videoIds;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'GetTranscodeSummary',
    version = '2017-03-21',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Queries transcoding summaries of audio and video files based on the file ID. A transcoding summary includes the status and progress of transcoding.
 *
 * @description *   An audio or video file may be transcoded multiple times. This operation returns only the latest transcoding summary.
 * *   You can query transcoding summaries for a maximum of 10 audio and video files in one request.
 * *   You can call the [ListTranscodeTask](https://help.aliyun.com/document_detail/109120.html) operation to query historical transcoding tasks.
 * *   **You can call this operation to query information only about transcoding tasks created within the past year.
 *
 * @param request GetTranscodeSummaryRequest
 * @return GetTranscodeSummaryResponse
 */
async function getTranscodeSummary(request: GetTranscodeSummaryRequest): GetTranscodeSummaryResponse {
  var runtime = new $RuntimeOptions{};
  return getTranscodeSummaryWithOptions(request, runtime);
}

model GetTranscodeTaskRequest {
  jobIds?: string(name='JobIds', description='Transcoding job ID. Supports up to 10 IDs, and multiple IDs should be separated by a comma (,). You can obtain this value in the following ways:

When initiating a transcoding task through the [SubmitTranscodeJobs](https://help.aliyun.com/document_detail/454920.html) interface, it is the value of the returned parameter JobId.', example='86c1925fba0****,7afb201e7fa****,2cc4997378****'),
  transcodeTaskId?: string(name='TranscodeTaskId', description='The ID of the transcoding task. You can use one of the following methods to obtain the ID:

*   Obtain the value of TranscodeTaskId from the response to the [SubmitTranscodeJobs](https://help.aliyun.com/document_detail/68570.html) operation.
*   Obtain the value of TranscodeTaskId from the response to the [ListTranscodeTask](https://help.aliyun.com/document_detail/109120.html) operation.', example='b1b65ab107e14*****3dbb900f6c1fe0'),
}

model GetTranscodeTaskResponseBody = {
  nonExistJobIds?: [ string ](name='NonExistJobIds', description='The nonexistent job ID.'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='F4C6D5BE-BF13-45*****6C-516EA8906DCD'),
  transcodeJobInfoList?: [ 
    {
      completeTime?: string(name='CompleteTime', description='The complete time of the transcoding job. The format is yyyy-MM-dd\\\\"T\\\\"HH:mm:ssZ (UTC time).', example='2019-02-26T08:30:16Z'),
      creationTime?: string(name='CreationTime', description='The creation time of the transcoding job. The format is yyyy-MM-dd\\\\"T\\\\"HH:mm:ssZ (UTC time).', example='2019-02-26T08:27:16Z'),
      definition?: string(name='Definition', description='The clarity and audio quality types are defined as follows:

- SD: Standard Definition.
- HD: High Definition.
- FHD: Full High Definition.
- OD: Original Definition.
- 2K: 2K.
- 4K: 4K.
- SQ: Standard Audio Quality.
- HQ: High Audio Quality.
- AUTO: Adaptive Bitrate.  This is only available when the transcoding template is configured with packaging settings. Please refer to [the Transcoding Template Configuration - Package Setting](https://api.aliyun-inc.com/~~52839~~?spm=openapi-amp.newDocPublishment.0.0.65b0281fNUFIXC) for more details.

> This value represents the clarity label configured in the transcoding template and does not indicate the actual resolution range of the transcoded output file.', example='LD'),
      errorCode?: string(name='ErrorCode', description='The error code.', example='200'),
      errorMessage?: string(name='ErrorMessage', description='The error message returned.', example='ErrorMessage'),
      inputFileUrl?: string(name='InputFileUrl', description='The OSS address of the source file for transcoding.', example='http://outin-40564*****e1403e7.oss-cn-shanghai.aliyuncs.com/customerTrans/5b95e568f8e*****47f38e/31f1184c-*****b2a2-f94-c213f.wmv'),
      outputFile?: {
        audioStreamList?: string(name='AudioStreamList', description='List of audio streams.', example='"AudioStreamList": "[{\\\\"Bitrate\\\\":\\\\"64.533\\\\",\\\\"ChannelLayout\\\\":\\\\"stereo\\\\",\\\\"Channels\\\\":\\\\"2\\\\",\\\\"CodecLongName\\\\":\\\\"AAC (Advanced Audio Coding)\\\\",\\\\"CodecName\\\\":\\\\"aac\\\\",\\\\"CodecTag\\\\":\\\\"0x6134706d\\\\",\\\\"CodecTagString\\\\":\\\\"mp4a\\\\",\\\\"CodecTimeBase\\\\":\\\\"1/44100\\\\",\\\\"Duration\\\\":\\\\"12.615533\\\\",\\\\"Index\\\\":\\\\"1\\\\",\\\\"Lang\\\\":\\\\"und\\\\",\\\\"SampleFmt\\\\":\\\\"fltp\\\\",\\\\"Samplerate\\\\":\\\\"44100\\\\",\\\\"StartTime\\\\":\\\\"-0.046440\\\\",\\\\"Timebase\\\\":\\\\"1/44100\\\\"}]'),
        bitrate?: string(name='Bitrate', description='Average bitrate of the transcoded output file. Unit: Kbps.', example='964'),
        duration?: string(name='Duration', description='Duration of the transcoded output file. Unit: seconds (s).', example='12'),
        encryption?: string(name='Encryption', description='Encryption configuration used for the transcoded output file. Values:

- AliyunVoDEncryption: Alibaba Cloud Video Encryption (private encryption).
- HLSEncryption: HLS standard encryption.', example='{\\\\"EncryptType\\\\":\\\\"AliyunVoDEncryption\\\\"}'),
        filesize?: long(name='Filesize', description='Size of the transcoded output file. Unit: bytes (B).', example='851076'),
        format?: string(name='Format', description='Container format of the transcoded output file.', example='m3u8'),
        fps?: string(name='Fps', description='Frame rate of the transcoded output file. Unit: frames per second (fps).', example='25'),
        height?: string(name='Height', description='Height of the video frame in the transcoded output file. Unit: pixels (px).', example='360'),
        outputFileUrl?: string(name='OutputFileUrl', description='OSS address of the transcoded output file.', example='http://outin-40564*****e1403e7.oss-cn-shanghai.aliyuncs.com/883f5d*****f20aaa352f/c3be4f073*****7d5193ec8-{DestMd5}-od-S00000001-200000.mp4'),
        subtitleStreamList?: string(name='SubtitleStreamList', description='List of subtitle streams.', example='[]'),
        videoStreamList?: string(name='VideoStreamList', description='List of video streams.', example='[{\\\\"AvgFPS\\\\":\\\\"30.0\\\\",\\\\"Bitrate\\\\":\\\\"933.814\\\\",\\\\"CodecLongName\\\\":\\\\"H.264 / AVC / MPEG-4 AVC / MPEG-4 part 10\\\\",\\\\"CodecName\\\\":\\\\"h264\\\\",\\\\"CodecTag\\\\":\\\\"0x31637661\\\\",\\\\"CodecTagString\\\\":\\\\"avc1\\\\",\\\\"CodecTimeBase\\\\":\\\\"1/60\\\\",\\\\"Dar\\\\":\\\\"9:16\\\\",\\\\"Duration\\\\":\\\\"12.033333\\\\",\\\\"Fps\\\\":\\\\"30.0\\\\",\\\\"HasBFrames\\\\":\\\\"2\\\\",\\\\"Height\\\\":\\\\"360\\\\",\\\\"Index\\\\":\\\\"0\\\\",\\\\"Lang\\\\":\\\\"und\\\\",\\\\"Level\\\\":\\\\"30\\\\",\\\\"PixFmt\\\\":\\\\"yuv420p\\\\",\\\\"Profile\\\\":\\\\"High\\\\",\\\\"Sar\\\\":\\\\"81:256\\\\",\\\\"StartTime\\\\":\\\\"0.000000\\\\",\\\\"Timebase\\\\":\\\\"1/15360\\\\",\\\\"Width\\\\":\\\\"640\\\\"}]'),
        watermarkIdList?: [ string ](name='WatermarkIdList', description='List of watermarks used for transcoding.'),
        width?: string(name='Width', description='Width of the video frame in the transcoded output file. Unit: pixels (px).', example='640'),
      }(name='OutputFile', description='Information about the transcoded output files.'),
      priority?: string(name='Priority', description='The priority of the transcoding task.', example='6'),
      transcodeJobId?: string(name='TranscodeJobId', description='The ID of the transcode job.', example='38f0e513c88*****85515f9d50be188'),
      transcodeJobStatus?: string(name='TranscodeJobStatus', description='The status of the transcoding job:

Transcoding: Transcoding in progress.
TranscodeSuccess: Transcoding successful.
TranscodeFail: Transcoding failed.', example='Transcoding'),
      transcodeProgress?: long(name='TranscodeProgress', description='The processing progress of the transcoding job. The value range is [0, 100].', example='80'),
      transcodeTemplateId?: string(name='TranscodeTemplateId', description='The ID of the template used for the transcode job.', example='174b0534fea3*****b51c8f0ad1374'),
    }
  ](name='TranscodeJobInfoList', description='List of transcode job information.'),
  transcodeTask?: {
    completeTime?: string(name='CompleteTime', description='The time when the transcoding task was complete. The time follows the ISO 8601 standard in the *yyyy-MM-dd*T*HH:mm:ss*Z format. The time is displayed in UTC.', example='2019-01-23T12:40:12Z'),
    creationTime?: string(name='CreationTime', description='The time when the transcoding task was created. The time follows the ISO 8601 standard in the *yyyy-MM-dd*T*HH:mm:ss*Z format. The time is displayed in UTC.', example='2019-01-23T12:35:12Z'),
    taskStatus?: string(name='TaskStatus', description='The status of the transcoding task. Valid values:

*   **Processing**: In progress.
*   **Partial**: Some transcoding jobs were complete.
*   **CompleteAllSucc**: All transcoding jobs were successful.
*   **CompleteAllFail**: All transcoding jobs failed. If an exception occurs in the source file, no transcoding job is initiated and the transcoding task fails.
*   **CompletePartialSucc**: All transcoding jobs were complete but only some were successful.', example='Processing'),
    transcodeJobInfoList?: [ 
      {
        completeTime?: string(name='CompleteTime', description='The time when the transcoding job was complete. The time follows the ISO 8601 standard in the *yyyy-MM-dd*T*HH:mm:ss*Z format. The time is displayed in UTC.', example='2019-02-26T08:30:16Z'),
        creationTime?: string(name='CreationTime', description='The time when the transcoding job was created. The time follows the ISO 8601 standard in the *yyyy-MM-dd*T*HH:mm:ss*Z format. The time is displayed in UTC.', example='2019-02-26T08:27:16Z'),
        definition?: string(name='Definition', description='The video resolution. Valid values:

*   **LD**: low definition
*   **SD**: standard definition
*   **HD**: high definition
*   **FHD**: ultra high definition
*   **OD**: original definition
*   **2K**: 2K
*   **4K**: 4K
*   **SQ**: standard sound quality
*   **HQ**: high sound quality
*   **AUTO**: adaptive bitrate Adaptive bitrate streams are returned only if PackageSetting is set in the transcoding template. For more information, see [Basic structures](https://help.aliyun.com/document_detail/52839.html).

> This parameter indicates the definition that is configured in the transcoding template and does not indicate the actual resolution of the output video.', example='LD'),
        errorCode?: string(name='ErrorCode', description='The error code returned when the transcoding job failed.', example='200'),
        errorMessage?: string(name='ErrorMessage', description='The error message returned when the transcoding job failed.', example='ErrorMessage'),
        inputFileUrl?: string(name='InputFileUrl', description='The Object Storage Service (OSS) URL of the input file.', example='http://outin-40564*****e1403e7.oss-cn-shanghai.aliyuncs.com/customerTrans/5b95e568f8e*****47f38e/31f1184c-*****b2a2-f94-c213f.wmv'),
        outputFile?: {
          audioStreamList?: string(name='AudioStreamList', description='The audio streams.', example='"AudioStreamList": "[{\\\\"Bitrate\\\\":\\\\"64.533\\\\",\\\\"ChannelLayout\\\\":\\\\"stereo\\\\",\\\\"Channels\\\\":\\\\"2\\\\",\\\\"CodecLongName\\\\":\\\\"AAC (Advanced Audio Coding)\\\\",\\\\"CodecName\\\\":\\\\"aac\\\\",\\\\"CodecTag\\\\":\\\\"0x6134706d\\\\",\\\\"CodecTagString\\\\":\\\\"mp4a\\\\",\\\\"CodecTimeBase\\\\":\\\\"1/44100\\\\",\\\\"Duration\\\\":\\\\"12.615533\\\\",\\\\"Index\\\\":\\\\"1\\\\",\\\\"Lang\\\\":\\\\"und\\\\",\\\\"SampleFmt\\\\":\\\\"fltp\\\\",\\\\"Samplerate\\\\":\\\\"44100\\\\",\\\\"StartTime\\\\":\\\\"-0.046440\\\\",\\\\"Timebase\\\\":\\\\"1/44100\\\\"}]'),
          bitrate?: string(name='Bitrate', description='The average bitrate of the output file. Unit: Kbit/s.', example='964'),
          duration?: string(name='Duration', description='The length of the output file. Unit: seconds.', example='12'),
          encryption?: string(name='Encryption', description='The encryption method of the output file. Valid values:

*   **AliyunVoDEncryption**: Alibaba Cloud proprietary cryptography
*   **HLSEncryption**: HTTP Live Streaming (HLS) encryption', example='{\\\\"EncryptType\\\\":\\\\"AliyunVoDEncryption\\\\"}'),
          filesize?: long(name='Filesize', description='The size of the output file. Unit: byte.', example='851076'),
          format?: string(name='Format', description='The container format of the output file.', example='m3u8'),
          fps?: string(name='Fps', description='The frame rate of the output file. Unit: frames per second.', example='25'),
          height?: string(name='Height', description='The height of the output video. Unit: pixels.', example='360'),
          outputFileUrl?: string(name='OutputFileUrl', description='The OSS URL of the output file.', example='http://outin-40564*****e1403e7.oss-cn-shanghai.aliyuncs.com/883f5d*****f20aaa352f/c3be4f073*****7d5193ec8-{DestMd5}-od-S00000001-200000.mp4'),
          subtitleStreamList?: string(name='SubtitleStreamList', description='The subtitle streams.', example='[]'),
          videoStreamList?: string(name='VideoStreamList', description='The video streams.', example='[{\\\\"AvgFPS\\\\":\\\\"30.0\\\\",\\\\"Bitrate\\\\":\\\\"933.814\\\\",\\\\"CodecLongName\\\\":\\\\"H.264 / AVC / MPEG-4 AVC / MPEG-4 part 10\\\\",\\\\"CodecName\\\\":\\\\"h264\\\\",\\\\"CodecTag\\\\":\\\\"0x31637661\\\\",\\\\"CodecTagString\\\\":\\\\"avc1\\\\",\\\\"CodecTimeBase\\\\":\\\\"1/60\\\\",\\\\"Dar\\\\":\\\\"9:16\\\\",\\\\"Duration\\\\":\\\\"12.033333\\\\",\\\\"Fps\\\\":\\\\"30.0\\\\",\\\\"HasBFrames\\\\":\\\\"2\\\\",\\\\"Height\\\\":\\\\"360\\\\",\\\\"Index\\\\":\\\\"0\\\\",\\\\"Lang\\\\":\\\\"und\\\\",\\\\"Level\\\\":\\\\"30\\\\",\\\\"PixFmt\\\\":\\\\"yuv420p\\\\",\\\\"Profile\\\\":\\\\"High\\\\",\\\\"Sar\\\\":\\\\"81:256\\\\",\\\\"StartTime\\\\":\\\\"0.000000\\\\",\\\\"Timebase\\\\":\\\\"1/15360\\\\",\\\\"Width\\\\":\\\\"640\\\\"}]'),
          watermarkIdList?: [ string ](name='WatermarkIdList', description='The IDs of the watermarks used by the output file.'),
          width?: string(name='Width', description='The width of the output video. Unit: pixels.', example='640'),
        }(name='OutputFile', description='The information about the output file.'),
        priority?: string(name='Priority', description='The priority of the transcoding job.', example='6'),
        transcodeJobId?: string(name='TranscodeJobId', description='The ID of the transcoding job.', example='38f0e513c88*****85515f9d50be188'),
        transcodeJobStatus?: string(name='TranscodeJobStatus', description='The status of the transcoding job.

*   **Transcoding**
*   **TranscodeSuccess**
*   **TranscodeFail**', example='Transcoding'),
        transcodeProgress?: long(name='TranscodeProgress', description='The progress of the transcoding job. Valid values: `[0,100]`.', example='100'),
        transcodeTemplateId?: string(name='TranscodeTemplateId', description='The ID of the transcoding template.', example='174b0534fea3*****b51c8f0ad1374'),
      }
    ](name='TranscodeJobInfoList', description='Details about transcoding jobs.'),
    transcodeTaskId?: string(name='TranscodeTaskId', description='The ID of the transcoding task.', example='b1b65ab107e14*****3dbb900f6c1fe0'),
    transcodeTemplateGroupId?: string(name='TranscodeTemplateGroupId', description='The ID of the transcoding template group.', example='b500c7094bd241*****3e9900752d7c3'),
    trigger?: string(name='Trigger', description='The mode in which the transcoding task is triggered. Valid values:

*   **Auto**: The transcoding task is automatically triggered when the video is uploaded.
*   **Manual**: The transcoding task is triggered by calling the SubmitTranscodeJobs operation.', example='Auto'),
    videoId?: string(name='VideoId', description='The ID of the audio or video file.', example='883f5d98107*****b7f20aaa352f'),
  }(name='TranscodeTask', description='Details about transcoding tasks.'),
}

model GetTranscodeTaskResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: GetTranscodeTaskResponseBody(name='body'),
}

/**
 * @summary Queries details about transcoding jobs based on the transcoding task ID.
 *
 * @description You can call this operation to query only transcoding tasks created within the past year.
 *
 * @param request GetTranscodeTaskRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return GetTranscodeTaskResponse
 */
async function getTranscodeTaskWithOptions(request: GetTranscodeTaskRequest, runtime: $RuntimeOptions): GetTranscodeTaskResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.jobIds)) {
    query['JobIds'] = request.jobIds;
  }
  if (!$isNull(request.transcodeTaskId)) {
    query['TranscodeTaskId'] = request.transcodeTaskId;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'GetTranscodeTask',
    version = '2017-03-21',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Queries details about transcoding jobs based on the transcoding task ID.
 *
 * @description You can call this operation to query only transcoding tasks created within the past year.
 *
 * @param request GetTranscodeTaskRequest
 * @return GetTranscodeTaskResponse
 */
async function getTranscodeTask(request: GetTranscodeTaskRequest): GetTranscodeTaskResponse {
  var runtime = new $RuntimeOptions{};
  return getTranscodeTaskWithOptions(request, runtime);
}

model GetTranscodeTemplateGroupRequest {
  transcodeTemplateGroupId?: string(name='TranscodeTemplateGroupId', description='The ID of the transcoding template group.

This parameter is required.', example='a591f697c7167*****6ae1502142d0'),
}

model GetTranscodeTemplateGroupResponseBody = {
  requestId?: string(name='RequestId', description='The request ID.', example='6730AC93-7B12-4B*****7F-49EE1FE8BC49'),
  transcodeTemplateGroup?: {
    appId?: string(name='AppId', description='The ID of the application.', example='app-****'),
    creationTime?: string(name='CreationTime', description='The time when the transcoding template group was created. The time follows the ISO 8601 standard in the *yyyy-MM-dd*T*hh:mm:ss*Z format. The time is displayed in UTC.', example='2018-12-12T10:20:51Z'),
    isDefault?: string(name='IsDefault', description='Indicates whether the template group is the default one. Valid values:

*   **Default**
*   **NotDefault**', example='NotDefault'),
    locked?: string(name='Locked', description='Indicates whether the transcoding template group is locked. Valid values:

*   **Disabled**: The template group is not locked.
*   **Enabled**: The template group is locked.', example='Enabled'),
    modifyTime?: string(name='ModifyTime', description='The time when the transcoding template group was last modified. The time follows the ISO 8601 standard in the *yyyy-MM-dd*T*hh:mm:ss*Z format. The time is displayed in UTC.', example='2018-12-12T11:20:51Z'),
    name?: string(name='Name', description='The name of the transcoding template group.', example='test'),
    transcodeTemplateGroupId?: string(name='TranscodeTemplateGroupId', description='The ID of the transcoding template group.', example='a59b11f697c716*****6ae1502142d0'),
    transcodeTemplateList?: [ 
      {
        audio?: string(name='Audio', description='The transcoding configurations of the audio stream. The value is a JSON string.', example='{\\\\"Codec\\\\":\\\\"AAC\\\\",\\\\"Remove\\\\":\\\\"false\\\\",\\\\"Bitrate\\\\":\\\\"44\\\\",\\\\"Samplerate\\\\":\\\\"32000\\\\",\\\\"Channels\\\\":\\\\"2\\\\",\\\\"Profile\\\\":\\\\"aac_low\\\\"}'),
        clip?: string(name='Clip', description='The clipping configurations of the video. The value is a JSON string. For example, this parameter is returned if you extract 5 seconds of content from a video to generate a new video.', example='{\\\\"TimeSpan\\\\":{\\\\"Seek\\\\":\\\\"1\\\\",\\\\"Duration\\\\":\\\\"5\\\\"}'),
        container?: string(name='Container', description='The format of the container used to encapsulate audio and video streams. The value is a JSON string.', example='"Format":"m3u8"'),
        copyrightMark?: string(name='CopyrightMark', description='The content of the copyright watermark.', example='{
	"Content": "test"
}'),
        definition?: string(name='Definition', description='Valid values for the definition of a common transcoding template:

*   **LD**: low definition.
*   **SD**: standard definition.
*   **HD**: high definition.
*   **FHD**: ultra high definition.
*   **OD**: original quality.
*   **2K**
*   **4K**
*   **SQ**: standard sound quality.
*   **HQ**: high sound quality.

Valid values for the definition of a Narrowband HD™ 1.0 transcoding template:

*   **LD-NBV1**: low definition.
*   **SD-NBV1**: standard definition.
*   **HD-NBV1**: high definition.
*   **FHD-NBV1**: ultra high definition.
*   **2K-NBV1**
*   **4K-NBV1**

> *   You cannot change the definition of a transcoding template.
>*   You cannot modify the system parameters, such as the video resolution, audio resolution, and bitrate, of Narrowband HD™ 1.0 transcoding templates.
>*   You can create only Narrowband HD™ 1.0 transcoding templates that support the FLV, M3U8 (HLS), and MP4 output formats.', example='SD'),
        encryptSetting?: string(name='EncryptSetting', description='The encryption configuration for transcoding.', example='"EncryptType":"Private"'),
        muxConfig?: string(name='MuxConfig', description='The transcoding segment configurations. This parameter must be returned if HTTP-Live-Streaming (HLS) encryption is used. The value is a JSON string.', example='"Segment": { "Duration":"6" }'),
        packageSetting?: string(name='PackageSetting', description='The packaging configuration. Only HLS packaging and DASH packaging are supported. The value is a JSON string.', example='"PackageType":"HLSPackage","PackageConfig":{   "BandWidth":"900000"  }'),
        rotate?: string(name='Rotate', description='The video rotation identifier. It is used to control the image rotation angle. For example, if you set this parameter to 180, the video image is turned upside down. Valid values: `[0,360]`.', example='90'),
        subtitleList?: string(name='SubtitleList', description='The subtitle configurations. The value is a JSON string.', example='[{"SubtitleUrl":"http://outin-test.oss-cn-shanghai.aliyuncs.com/subtitles/c737fece-14f1-4364-b107-d5f7f8edde0e.ass","CharEncode":"utf-8"}]'),
        templateName?: string(name='TemplateName', description='The name of the transcoding template.', example='test'),
        traceMark?: string(name='TraceMark', description='The content of the tracing watermark.', example='{
	"Enable": true
}'),
        transConfig?: string(name='TransConfig', description='The conditional transcoding configurations. This parameter can be used if you want to determine the basic logic based on the bitrate and resolution of the source file before the video is transcoded. The value is a JSON-formatted string.', example='{"IsCheckReso":"true","IsCheckResoFail":"false","IsCheckVideoBitrate":"false","IsCheckVideoBitrateFail":"false","IsCheckAudioBitrate":"false","IsCheckAudioBitrateFail":"false"}'),
        transcodeFileRegular?: string(name='TranscodeFileRegular', description='The custom path used to store the output files.', example='{MediaId}/transcoce_1'),
        transcodeTemplateId?: string(name='TranscodeTemplateId', description='The transcoding template ID.', example='696d29a11erc057*****a3acc398d02f4'),
        type?: string(name='Type', description='The type of the transcoding template. Valid values:

*   **Normal** (default): a common transcoding template. The PackageSetting parameter cannot be set for this type of template.
*   **VideoPackage**: a video stream package template. If this type of template is used, ApsaraVideo VOD transcodes a video into video streams in different bitrates and packages these video streams with a file. The PackageSetting parameter must be set for this type of template.
*   **SubtitlePackage**: a subtitle package template. If this type of template is used, ApsaraVideo VOD adds the subtitle information to the output file generated by packaging the multi-bitrate video streams of the corresponding video without transcoding. You must set the PackageSetting parameter for a subtitle package template and associate the subtitle package template with a video stream package template. A template group can contain only one subtitle package template.', example='Normal'),
        video?: string(name='Video', description='The transcoding configurations of the video stream. The value is a JSON string.', example='{"Codec":"H.264","Bitrate":"900","Width":"960","Remove":"false","Fps":"30"}'),
        watermarkIds?: [ string ](name='WatermarkIds', description='The IDs of the associated watermarks.'),
      }
    ](name='TranscodeTemplateList', description='The information about the transcoding templates.'),
  }(name='TranscodeTemplateGroup', description='The information about the transcoding template group.'),
}

model GetTranscodeTemplateGroupResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: GetTranscodeTemplateGroupResponseBody(name='body'),
}

/**
 * @summary Queries the details of a transcoding template group based on the template group ID.
 *
 * @description This operation returns information about the specified transcoding template group and the configurations of all the transcoding templates in the group.
 *
 * @param request GetTranscodeTemplateGroupRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return GetTranscodeTemplateGroupResponse
 */
async function getTranscodeTemplateGroupWithOptions(request: GetTranscodeTemplateGroupRequest, runtime: $RuntimeOptions): GetTranscodeTemplateGroupResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.transcodeTemplateGroupId)) {
    query['TranscodeTemplateGroupId'] = request.transcodeTemplateGroupId;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'GetTranscodeTemplateGroup',
    version = '2017-03-21',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Queries the details of a transcoding template group based on the template group ID.
 *
 * @description This operation returns information about the specified transcoding template group and the configurations of all the transcoding templates in the group.
 *
 * @param request GetTranscodeTemplateGroupRequest
 * @return GetTranscodeTemplateGroupResponse
 */
async function getTranscodeTemplateGroup(request: GetTranscodeTemplateGroupRequest): GetTranscodeTemplateGroupResponse {
  var runtime = new $RuntimeOptions{};
  return getTranscodeTemplateGroupWithOptions(request, runtime);
}

model GetURLUploadInfosRequest {
  jobIds?: string(name='JobIds', description='The one or more IDs of upload jobs. You can obtain the job IDs in the response parameter JobId of the [UploadMediaByURL](https://help.aliyun.com/document_detail/86311.html) operation.

- You can specify a maximum of 10 IDs.
- Separate multiple IDs with commas (,).

> You must set one of the JobIds and the UploadURLs parameters. If you set both the JobIds and UploadURLs parameters, only the value of the JobIds parameter takes effect.', example='86c1925fba0****,7afb201e7fa****,2cc4997378****'),
  uploadURLs?: string(name='UploadURLs', description='The one or more upload URLs of the source files. Separate multiple URLs with commas (,). You can specify a maximum of 10 URLs.

> * You must encode the URLs before you use the URLs.
> * If a media file is uploaded multiple times, pass the URL of the media file to this parameter only once.
> * You must set one of the JobIds and the UploadURLs parameters. If you set both the JobIds and UploadURLs parameters, only the value of the JobIds parameter takes effect.', example='http://****.mp4'),
}

model GetURLUploadInfosResponseBody = {
  nonExists?: [ string ](name='NonExists', description='The job IDs or upload URLs that do not exist.'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='25818875-5F78-4AF6-D7393642CA58****'),
  URLUploadInfoList?: [ 
    {
      completeTime?: string(name='CompleteTime', description='The time when the upload job was complete. The time follows the ISO 8601 standard in the *yyyy-MM-dd*T*HH:mm:ss*Z format. The time is displayed in UTC.', example='2019-01-01T01:11:01Z'),
      creationTime?: string(name='CreationTime', description='The time when the upload job was created. The time follows the ISO 8601 standard in the *yyyy-MM-dd*T*HH:mm:ss*Z format. The time is displayed in UTC.', example='2019-01-01T01:01:01Z'),
      errorCode?: string(name='ErrorCode', description='The error code returned.', example='200'),
      errorMessage?: string(name='ErrorMessage', description='The error message returned.', example='error_message'),
      fileSize?: string(name='FileSize', description='The size of the uploaded media file. Unit: byte.', example='24'),
      jobId?: string(name='JobId', description='The ID of the upload job.', example='86c1925fba0****'),
      mediaId?: string(name='MediaId', description='The ID of the uploaded media file.', example='93ab850b4f6f54b6e91d24d81d4****'),
      status?: string(name='Status', description='The status of the URL-based upload job. For more information about the valid values and value description of the parameter, see the "Status: the status of a video" section of the [Basic structures](https://help.aliyun.com/document_detail/52839.html) topic.', example='SUCCESS'),
      uploadURL?: string(name='UploadURL', description='The upload URL of the source file.

> A maximum of 100 URLs can be returned.', example='http://****.mp4'),
      userData?: string(name='UserData', description='The custom configurations. The value is a JSON string. For more information, see the "UserData: specifies the custom configurations for media upload" section of the [Request parameters](https://help.aliyun.com/document_detail/86952.html) topic.', example='{"MessageCallback":"{"CallbackURL":"http://example.aliyundoc.com"}", "Extend":"{"localId":"***", "test":"www"}"}'),
    }
  ](name='URLUploadInfoList', description='The information about URL-based upload jobs. For more information, see the "URLUploadInfo: the information about a URL-based upload job" section of the [Basic structures](https://help.aliyun.com/document_detail/52839.html) topic.'),
}

model GetURLUploadInfosResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: GetURLUploadInfosResponseBody(name='body'),
}

/**
 * @summary Queries the information about URL-based upload jobs.
 *
 * @description You can query the information about a URL-based upload job by specifying the upload URL or using the job ID returned when you upload media files. The information includes the status of the upload job, custom configurations, the time when the job was created, and the time when the job was complete.
 * If the upload fails, you can view the error code and error message. If the upload is successful, you can obtain the video ID.
 *
 * @param request GetURLUploadInfosRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return GetURLUploadInfosResponse
 */
async function getURLUploadInfosWithOptions(request: GetURLUploadInfosRequest, runtime: $RuntimeOptions): GetURLUploadInfosResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.jobIds)) {
    query['JobIds'] = request.jobIds;
  }
  if (!$isNull(request.uploadURLs)) {
    query['UploadURLs'] = request.uploadURLs;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'GetURLUploadInfos',
    version = '2017-03-21',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Queries the information about URL-based upload jobs.
 *
 * @description You can query the information about a URL-based upload job by specifying the upload URL or using the job ID returned when you upload media files. The information includes the status of the upload job, custom configurations, the time when the job was created, and the time when the job was complete.
 * If the upload fails, you can view the error code and error message. If the upload is successful, you can obtain the video ID.
 *
 * @param request GetURLUploadInfosRequest
 * @return GetURLUploadInfosResponse
 */
async function getURLUploadInfos(request: GetURLUploadInfosRequest): GetURLUploadInfosResponse {
  var runtime = new $RuntimeOptions{};
  return getURLUploadInfosWithOptions(request, runtime);
}

model GetUploadDetailsRequest {
  mediaIds?: string(name='MediaIds', description='The ID of the media file, namely, the audio or video ID. You can specify a maximum of 20 IDs. Separate multiple IDs with commas (,). You can use one of the following methods to obtain the audio or video ID:
*   Log on to the [ApsaraVideo VOD](https://vod.console.aliyun.com) console. In the left-side navigation pane, choose **Media Files** > **Audio/Video**. On the Video and Audio page, you can view the audio or video ID. Use this method if the audio or video file is uploaded by using the ApsaraVideo VOD console.
*   View the value of the VideoId parameter returned by the [CreateUploadVideo](https://help.aliyun.com/document_detail/55407.html) operation that you called to obtain an upload URL and credential.
*   View the value of the VideoId parameter returned by the [SearchMedia](https://help.aliyun.com/document_detail/86044.html) operation that you called to query media information after the audio or video file is uploaded.

This parameter is required.', example='61ccbdb06fa83012be4d8083f6****,7d2fbc380b0e08e55f****'),
  mediaType?: string(name='MediaType', description='The type of the media file. Set the value to **video**, which indicates audio and video files.', example='video'),
}

model GetUploadDetailsResponseBody = {
  forbiddenMediaIds?: [ string ](name='ForbiddenMediaIds', description='The IDs of the media files that cannot be accessed.'),
  nonExistMediaIds?: [ string ](name='NonExistMediaIds', description='The IDs of the media files that do not exist.'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='9E290613-04F4-47F4-795D30732077****'),
  uploadDetails?: [ 
    {
      completionTime?: string(name='CompletionTime', description='The time when the upload job was complete. The time follows the ISO 8601 standard in the *yyyy-MM-dd*T*HH:mm:ss*Z format. The time is displayed in UTC.', example='2019-04-28T09:45:07Z'),
      creationTime?: string(name='CreationTime', description='The time when the upload job was created. The time follows the ISO 8601 standard in the *yyyy-MM-dd*T*HH:mm:ss*Z format. The time is displayed in UTC.', example='2019-04-28T09:42:07Z'),
      deviceModel?: string(name='DeviceModel', description='The device model.', example='Chrome'),
      fileSize?: long(name='FileSize', description='The size of the uploaded file. Unit: byte.', example='46'),
      mediaId?: string(name='MediaId', description='The ID of the uploaded audio or video.', example='61ccbdb06fa83012be4d8083f6****'),
      modificationTime?: string(name='ModificationTime', description='The time when the information about the media file was updated. The time follows the ISO 8601 standard in the yyyy-MM-ddTHH:mm:ssZ format. The time is displayed in UTC.', example='2019-04-28T09:43:12Z'),
      status?: string(name='Status', description='The status of the video. For more information about the valid values and value description of the parameter, see the "Status: the status of a video" section of the [Basic structures](https://help.aliyun.com/document_detail/52839.html) topic.', example='Uploading'),
      title?: string(name='Title', description='The title of the media file.', example='Test details'),
      uploadIP?: string(name='UploadIP', description='The IP address of the server that uploads the media file.', example='192.168.0.1'),
      uploadRatio?: float(name='UploadRatio', description='The upload ratio.', example='0.038'),
      uploadSize?: long(name='UploadSize', description='The upload size. Unit: byte.', example='346'),
      uploadSource?: string(name='UploadSource', description='The method that is used to upload the media file.', example='WebSDK'),
      uploadStatus?: string(name='UploadStatus', description='The status of the upload job. For more information about the valid values and value description of the parameter, see the "Status: the status of a URL-based upload job" section of the [Basic structures](https://help.aliyun.com/document_detail/52839.html) topic.', example='Uploading'),
    }
  ](name='UploadDetails', description='The upload details.'),
}

model GetUploadDetailsResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: GetUploadDetailsResponseBody(name='body'),
}

/**
 * @summary Queries the upload details, such as the upload time, upload ratio, and upload source, about one or more media files based on the media IDs.
 *
 * @description *   You can call this operation to obtain the upload details only about audio and video files.
 * *   If you use the ApsaraVideo VOD console to upload audio and video files, you can call this operation to query information such as the upload ratio. If you use an upload SDK to upload audio and video files, make sure that the version of the [upload SDK](https://help.aliyun.com/document_detail/52200.html) meets one of the following requirements:
 *     *   The version of the upload SDK for Java is 1.4.4 or later.
 *     *   The version of the upload SDK for C++ is 1.0.0 or later.
 *     *   The version of the upload SDK for PHP is 1.0.2 or later.
 *     *   The version of the upload SDK for Python is 1.3.0 or later.
 *     *   The version of the upload SDK for JavaScript is 1.4.0 or later.
 *     *   The version of the upload SDK for Android is 1.5.0 or later.
 *     *   The version of the upload SDK for iOS is 1.5.0 or later.
 *
 * @param request GetUploadDetailsRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return GetUploadDetailsResponse
 */
async function getUploadDetailsWithOptions(request: GetUploadDetailsRequest, runtime: $RuntimeOptions): GetUploadDetailsResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.mediaIds)) {
    query['MediaIds'] = request.mediaIds;
  }
  if (!$isNull(request.mediaType)) {
    query['MediaType'] = request.mediaType;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'GetUploadDetails',
    version = '2017-03-21',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Queries the upload details, such as the upload time, upload ratio, and upload source, about one or more media files based on the media IDs.
 *
 * @description *   You can call this operation to obtain the upload details only about audio and video files.
 * *   If you use the ApsaraVideo VOD console to upload audio and video files, you can call this operation to query information such as the upload ratio. If you use an upload SDK to upload audio and video files, make sure that the version of the [upload SDK](https://help.aliyun.com/document_detail/52200.html) meets one of the following requirements:
 *     *   The version of the upload SDK for Java is 1.4.4 or later.
 *     *   The version of the upload SDK for C++ is 1.0.0 or later.
 *     *   The version of the upload SDK for PHP is 1.0.2 or later.
 *     *   The version of the upload SDK for Python is 1.3.0 or later.
 *     *   The version of the upload SDK for JavaScript is 1.4.0 or later.
 *     *   The version of the upload SDK for Android is 1.5.0 or later.
 *     *   The version of the upload SDK for iOS is 1.5.0 or later.
 *
 * @param request GetUploadDetailsRequest
 * @return GetUploadDetailsResponse
 */
async function getUploadDetails(request: GetUploadDetailsRequest): GetUploadDetailsResponse {
  var runtime = new $RuntimeOptions{};
  return getUploadDetailsWithOptions(request, runtime);
}

model GetVideoInfoRequest {
  videoId?: string(name='VideoId', description='The ID of the audio or video file. You can specify only one ID in each call. You can use one of the following methods to obtain the ID:

*   Log on to the [ApsaraVideo VOD console](https://vod.console.aliyun.com). In the left-side navigation pane, choose **Media Files** > **Audio/Video**. On the Video and Audio page, view the ID of the audio or video file. This method is applicable to files that are uploaded by using the ApsaraVideo VOD console.
*   Obtain the value of VideoId from the response to the [CreateUploadVideo](https://help.aliyun.com/document_detail/55407.html) operation that you called to obtain the upload URL and credential.
*   Obtain the value of VideoId from the response to the [SearchMedia](https://help.aliyun.com/document_detail/86044.html) operation that you called to query the media ID after the media file is uploaded.

This parameter is required.', example='9b73864d75f1d231e9001cd5f8****'),
}

model GetVideoInfoResponseBody = {
  requestId?: string(name='RequestId', description='The ID of the request.', example='25818875-5F78-4AF6-D7393642CA58****'),
  video?: {
    appId?: string(name='AppId', description='The ID of the application.', example='app-****'),
    auditStatus?: string(name='AuditStatus', description='The final review result of the audio or video file. Valid values:

*   **Normal**: pass
*   **Blocked**: blocked', example='Normal'),
    cateId?: long(name='CateId', description='The category ID of the media file.', example='781111****'),
    cateName?: string(name='CateName', description='The name of the category.', example='Category name'),
    coverURL?: string(name='CoverURL', description='The thumbnail URL of the media file.', example='https://example.aliyundoc.com/****.jpg'),
    creationTime?: string(name='CreationTime', description='The time when the media file was created. The time follows the ISO 8601 standard in the *yyyy-MM-dd*T*HH:mm:ss*Z format. The time is displayed in UTC.', example='2017-11-14T09:15:50Z'),
    customMediaInfo?: string(name='CustomMediaInfo', description='The custom information about the media file.\\\\n\\\\n> This parameter has been deprecated. This parameter is no longer returned after you call the operation.', example='{"aaa":"test"}'),
    description?: string(name='Description', description='The description of the media file.', example='Video description in ApsaraVideo VOD'),
    downloadSwitch?: string(name='DownloadSwitch', description='Indicates whether the offline download feature is enabled. If you enable the offline download feature, users can download and play videos by using the ApsaraVideo Player on a local PC. For more information, see [Configure download settings](https://help.aliyun.com/document_detail/86107.html). Valid values:

*   **on**: the offline download feature is enabled.
*   **off**: the offline download feature is not enabled.', example='on'),
    duration?: float(name='Duration', description='The duration of the media file. Unit: seconds.', example='135.6'),
    modificationTime?: string(name='ModificationTime', description='The time when the audio or video file was last updated. The time follows the ISO 8601 standard in the *yyyy-MM-dd*T*HH:mm:ss*Z format. The time is displayed in UTC.', example='2017-11-14T10:15:50Z'),
    regionId?: string(name='RegionId', description='The region where the media file is stored.', example='cn-shanghai'),
    restoreExpiration?: string(name='RestoreExpiration', description='The period of time in which the object remains in the restored state.', example='2023-03-30T10:14:14Z'),
    restoreStatus?: string(name='RestoreStatus', description='The restoration status of the audio or video file. Valid values:

*   **Processing**
*   **Success**
*   **Failed**', example='Success'),
    size?: long(name='Size', description='The size of the source file. Unit: bytes.', example='10897890'),
    snapshots?: {
      snapshot?: [ string ](name='Snapshot')
    }(name='Snapshots', description='The video snapshot URLs.'),
    status?: string(name='Status', description='The status of the media file. For more information about the operations that you can perform on files in different statuses and usage limits, see [Status: the status of a video](~~52839#title-vqg-8cz-7p8~~). Valid values:

*   **Uploading**
*   **UploadFail**
*   **UploadSucc**
*   **Transcoding**
*   **TranscodeFail**
*   **Blocked**
*   **Normal**', example='Normal'),
    storageClass?: string(name='StorageClass', description='The storage class of the audio or video file. Valid values:

*   **Standard**: All media resources are stored as Standard objects.
*   **IA**: All media resources are stored as IA objects.
*   **Archive**: All media resources are stored as Archive objects.
*   **ColdArchive**: All media resources are stored as Cold Archive objects.
*   **SourceIA**: Only the source files are IA objects.
*   **SourceArchive**: Only the source files are Archive objects.
*   **SourceColdArchive**: Only the source files are Cold Archive objects.
*   **Changing**: The storage class of the audio or video file is being changed.
*   **SourceChanging**: The storage class of the source file is being changed.', example='Standard'),
    storageLocation?: string(name='StorageLocation', description='The storage address of the media file.', example='out-201703232251****.oss-cn-shanghai.aliyuncs.com'),
    tags?: string(name='Tags', description='The tags of the audio or video file. Multiple tags are separated by commas (,).', example='Tag 1,Tag 2'),
    templateGroupId?: string(name='TemplateGroupId', description='The ID of the transcoding template group.', example='9ae2af636ca64835b0c10412f448****'),
    title?: string(name='Title', description='The title of the media file.', example='Video title in ApsaraVideo VOD'),
    userData?: string(name='UserData', description='Custom settings. This is a JSON string that supports settings such as message callbacks and upload acceleration. For more information, please refer to [UserData](https://help.aliyun.com/document_detail/86952.html).', example='{"MessageCallback":{"CallbackURL":"http://example.aliyundoc.com"},"Extend":{"localId":"*****","test":"www"}}'),
    videoId?: string(name='VideoId', description='The ID of the media file.', example='9b73864d75f1d231e9001cd5f8****'),
  }(name='Video', description='The information about the audio or video file.'),
}

model GetVideoInfoResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: GetVideoInfoResponseBody(name='body'),
}

/**
 * @summary Obtains the title, description, duration, thumbnail URL, status, creation time, size, snapshots, category, and tags of a media file based on the file ID.
 *
 * @description After a media file is uploaded, ApsaraVideo VOD processes the source file. Then, information about the media file is asynchronously generated. You can configure notifications for the [VideoAnalysisComplete](https://help.aliyun.com/document_detail/99935.html) event and call this operation to query information about a media file after you receive notifications for the [VideoAnalysisComplete](https://help.aliyun.com/document_detail/99935.html) event. For more information, see [Overview](https://help.aliyun.com/document_detail/55627.html).
 *
 * @param request GetVideoInfoRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return GetVideoInfoResponse
 */
async function getVideoInfoWithOptions(request: GetVideoInfoRequest, runtime: $RuntimeOptions): GetVideoInfoResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.videoId)) {
    query['VideoId'] = request.videoId;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'GetVideoInfo',
    version = '2017-03-21',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Obtains the title, description, duration, thumbnail URL, status, creation time, size, snapshots, category, and tags of a media file based on the file ID.
 *
 * @description After a media file is uploaded, ApsaraVideo VOD processes the source file. Then, information about the media file is asynchronously generated. You can configure notifications for the [VideoAnalysisComplete](https://help.aliyun.com/document_detail/99935.html) event and call this operation to query information about a media file after you receive notifications for the [VideoAnalysisComplete](https://help.aliyun.com/document_detail/99935.html) event. For more information, see [Overview](https://help.aliyun.com/document_detail/55627.html).
 *
 * @param request GetVideoInfoRequest
 * @return GetVideoInfoResponse
 */
async function getVideoInfo(request: GetVideoInfoRequest): GetVideoInfoResponse {
  var runtime = new $RuntimeOptions{};
  return getVideoInfoWithOptions(request, runtime);
}

model GetVideoInfosRequest {
  videoIds?: string(name='VideoIds', description='The list of video IDs. Separate multiple IDs with commas (,). A maximum of 20 IDs can be specified.

This parameter is required.', example='7753d144efd8e649c6c45fe0579****,7753d144efd74d6c45fe0570****'),
}

model GetVideoInfosResponseBody = {
  nonExistVideoIds?: [ string ](name='NonExistVideoIds', description='The IDs of the videos that do not exist.'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='25818875-5F78-4AF6-D7393642CA58****'),
  videoList?: [ 
    {
      appId?: string(name='AppId', description='The ID of the application.', example='app-****'),
      cateId?: long(name='CateId', description='The ID of the category.', example='781111****'),
      cateName?: string(name='CateName', description='The name of the category.', example='This is a category name.'),
      coverURL?: string(name='CoverURL', description='The thumbnail URL of the audio or video file.', example='https://example.aliyundoc.com/****.jpg'),
      creationTime?: string(name='CreationTime', description='The time when the media file was created. The time is in the *yyyy-MM-dd*T*HH:mm:ss*Z format. The time is displayed in UTC.', example='2017-06-26T05:38:48Z'),
      description?: string(name='Description', description='The description of the audio or video file.', example='This is a category description.'),
      downloadSwitch?: string(name='DownloadSwitch', description='Indicates whether the offline download feature is enabled. If you enable the offline download feature, users can download and play videos by using the ApsaraVideo Player on a local PC. For more information, see [Configure download settings](https://help.aliyun.com/document_detail/86107.html). Valid values:

*   **on**: the offline download feature is enabled.
*   **off**: the offline download feature is not enabled.', example='on'),
      duration?: float(name='Duration', description='The duration of the audio or video file. Unit: seconds.', example='120'),
      modificationTime?: string(name='ModificationTime', description='The time when the audio or video file was last updated. The time is in the *yyyy-MM-dd*T*HH:mm:ss*Z format. The time is displayed in UTC.', example='2017-06-26T06:38:48Z'),
      restoreExpiration?: string(name='RestoreExpiration', description='The period of time in which the audio file remains in the restored state.', example='2023-03-30T10:14:14Z'),
      restoreStatus?: string(name='RestoreStatus', description='The restoration status of the audio file. Valid values:

*   **Processing**
*   **Success**
*   **Failed**', example='Success'),
      size?: long(name='Size', description='The size of the source file. Unit: bytes.', example='453'),
      snapshots?: [ string ](name='Snapshots', description='The video snapshot URLs.'),
      status?: string(name='Status', description='The status of the video. Valid values:

*   **Uploading**
*   **UploadFail**
*   **UploadSucc**
*   **Transcoding**
*   **TranscodeFail**
*   **Blocked**
*   **Normal**', example='Normal'),
      storageClass?: string(name='StorageClass', description='The storage class of the audio file. Valid values:

*   **Standard**: All media resources are stored as Standard objects.
*   **IA**: All media resources are stored as IA objects.
*   **Archive**: All media resources are stored as Archive objects.
*   **ColdArchive**: All media resources are stored as Cold Archive objects.
*   **SourceIA**: Only the source files are IA objects.
*   **SourceArchive**: Only the source files are Archive objects.
*   **SourceColdArchive**: Only the source file is stored as a Cold Archive object.
*   **Changing**: The storage class of the video file is being changed.
*   **SourceChanging**: The storage class of the source file is being changed.', example='Standard'),
      storageLocation?: string(name='StorageLocation', description='The storage address of the audio or video file.', example='out-****.oss-cn-shanghai.aliyuncs.com'),
      tags?: string(name='Tags', description='The tags of the audio or video file. Multiple tags are separated by commas (,).', example='tag1, tag2'),
      templateGroupId?: string(name='TemplateGroupId', description='The ID of the transcoding template group.', example='b4039216985f4312a5382a4ed****'),
      title?: string(name='Title', description='The title of the audio or video file.', example='Video tiltle'),
      userData?: string(name='UserData', description='Custom settings. This is a JSON string that supports settings such as message callbacks and upload acceleration. For more information, please refer to [UserData](https://help.aliyun.com/document_detail/86952.html).', example='{"MessageCallback":{"CallbackURL":"http://example.aliyundoc.com"},"Extend":{"localId":"*****","test":"www"}}'),
      videoId?: string(name='VideoId', description='The ID of the audio or video file.', example='7753d144efd74d6c45fe0570****'),
    }
  ](name='VideoList', description='The information about the audio or video files.'),
}

model GetVideoInfosResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: GetVideoInfosResponseBody(name='body'),
}

/**
 * @summary Queries information such as the title, description, duration, thumbnail URL, status, creation time, size, snapshots, category, and tags about multiple audio or video files based on IDs.
 *
 * @description *   You can specify up to 20 audio or video file IDs in each request.
 * *   After a media file is uploaded, ApsaraVideo VOD processes the source file. Then, information about the media file is asynchronously generated. You can configure notifications for the [VideoAnalysisComplete](https://help.aliyun.com/document_detail/99935.html) event and call this operation to query information about a media file after you receive notifications for the [VideoAnalysisComplete](https://help.aliyun.com/document_detail/99935.html) event. For more information, see [Overview](https://help.aliyun.com/document_detail/55627.html).
 *
 * @param request GetVideoInfosRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return GetVideoInfosResponse
 */
async function getVideoInfosWithOptions(request: GetVideoInfosRequest, runtime: $RuntimeOptions): GetVideoInfosResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.videoIds)) {
    query['VideoIds'] = request.videoIds;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'GetVideoInfos',
    version = '2017-03-21',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Queries information such as the title, description, duration, thumbnail URL, status, creation time, size, snapshots, category, and tags about multiple audio or video files based on IDs.
 *
 * @description *   You can specify up to 20 audio or video file IDs in each request.
 * *   After a media file is uploaded, ApsaraVideo VOD processes the source file. Then, information about the media file is asynchronously generated. You can configure notifications for the [VideoAnalysisComplete](https://help.aliyun.com/document_detail/99935.html) event and call this operation to query information about a media file after you receive notifications for the [VideoAnalysisComplete](https://help.aliyun.com/document_detail/99935.html) event. For more information, see [Overview](https://help.aliyun.com/document_detail/55627.html).
 *
 * @param request GetVideoInfosRequest
 * @return GetVideoInfosResponse
 */
async function getVideoInfos(request: GetVideoInfosRequest): GetVideoInfosResponse {
  var runtime = new $RuntimeOptions{};
  return getVideoInfosWithOptions(request, runtime);
}

model GetVideoListRequest {
  cateId?: long(name='CateId', description='The ID of the category. You can use one of the following methods to obtain the category ID:

*   Log on to the [ApsaraVideo VOD console](https://vod.console.aliyun.com). In the left-side navigation pane, choose **Configuration Management** > **Media Management** > **Categories** to view the category ID.
*   Obtain the value of CateId from the response to the [AddCategory](https://help.aliyun.com/document_detail/56401.html) operation.
*   Obtain the value of CateId from the response to the [GetCategories](https://help.aliyun.com/document_detail/56406.html) operation.', example='781111'),
  endTime?: string(name='EndTime', description='The end of the time range to query. The end time must be later than the start time. Specify the time in the ISO 8601 standard in the *yyyy-MM-dd*T*HH:mm:ss*Z format. The time must be in UTC.', example='2017-01-11T12:59:00Z'),
  pageNo?: int32(name='PageNo', description='The number of the page to return. Default value: **1**.', example='1'),
  pageSize?: int32(name='PageSize', description='The number of entries to return on each page. Default value: **10**. Maximum value: **100**.', example='10'),
  sortBy?: string(name='SortBy', description='The sorting method of the results. Valid values:

*   **CreationTime:Desc** (default): The results are sorted in reverse chronological order based on the creation time.
*   **CreationTime:Asc**: The results are sorted in chronological order based on the creation time.', example='CreationTime:Asc'),
  startTime?: string(name='StartTime', description='The beginning of the time range to query. Specify the time in the ISO 8601 standard in the *yyyy-MM-dd*T*HH:mm:ss*Z format. The time must be in UTC.', example='2017-01-11T12:00:00Z'),
  status?: string(name='Status', description='The status of the video. You can specify multiple video statuses and separate them with commas (,). Valid values:

*   **Uploading**: The video is being uploaded.
*   **UploadFail**: The video failed to be uploaded.
*   **UploadSucc**: The video has been uploaded.
*   **Transcoding**: The video is being transcoded.
*   **TranscodeFail**: The video failed to be transcoded.
*   **checking**: The video is being reviewed.
*   **Blocked**: The video is blocked.
*   **Normal**: The video is normal.
*   **ProduceFail**: The video failed to be produced.

For more information about each video status, see the "Status: the status of a video" section of the [Basic data types](~~52839#section-p7c-jgy-070~~) topic.', example='Uploading,Normal'),
  storageLocation?: string(name='StorageLocation', description='The storage address of the media file.', example='out-****.oss-cn-shanghai.aliyuncs.com'),
}

model GetVideoListResponseBody = {
  requestId?: string(name='RequestId', description='The ID of the request.', example='25818875-5F78-4AF6-D7393642CA58****'),
  total?: int32(name='Total', description='The total number of media files returned.', example='100'),
  videoList?: {
    video?: [ 
    {
      appId?: string(name='AppId', description='The ID of the application. Default value: **app-1000000**.', example='app-1000000'),
      cateId?: long(name='CateId', description='The category ID of the audio or video file.', example='781111'),
      cateName?: string(name='CateName', description='The name of the category.', example='Category name'),
      coverURL?: string(name='CoverURL', description='The thumbnail URL of the audio or video file.', example='https://example.aliyundoc.com/****.jpg'),
      creationTime?: string(name='CreationTime', description='The time when the audio or video file was created. The time follows the ISO 8601 standard in the *yyyy-MM-dd*T*hh:mm:ss*Z format. The time is displayed in UTC.', example='2017-11-14T09:15:50Z'),
      description?: string(name='Description', description='The description of the audio or video file.', example='Video description in ApsaraVideo VOD'),
      duration?: float(name='Duration', description='The duration of the audio or video file. Unit: seconds. 86,400 seconds is equivalent to 24 hours.', example='135.6'),
      modificationTime?: string(name='ModificationTime', description='The time when the video was updated. The time follows the ISO 8601 standard in the *yyyy-MM-dd*T*hh:mm:ss*Z format. The time is displayed in UTC.', example='2017-11-14T09:16:50Z'),
      restoreExpiration?: string(name='RestoreExpiration', description='The period of time in which the audio or video file remains in the restored state.', example='2023-03-30T10:14:14Z'),
      restoreStatus?: string(name='RestoreStatus', description='The restoration status of the audio or video file. Valid values:

*   **Processing**
*   **Success**
*   **Failed**', example='Success'),
      size?: long(name='Size', description='The size of the source file. Unit: bytes.', example='10897890'),
      snapshots?: {
        snapshot?: [ string ](name='Snapshot')
      }(name='Snapshots', description='The URL array of video snapshots.'),
      status?: string(name='Status', description='The status of the audio or video file. Valid values:

*   **Uploading**: The video is being uploaded.
*   **UploadFail**: The video failed to be uploaded.
*   **UploadSucc**: The video is uploaded.
*   **Transcoding**: The video is being transcoded.
*   **TranscodeFail**: The video failed to be transcoded.
*   **checking**: The video is being reviewed.
*   **Blocked**: The video is blocked.
*   **Normal**: The video is normal.
*   **ProduceFail**: The video failed to be produced.

For more information about each video status, see the "Status: the status of a video" section of the [Basic data types](~~52839#section-p7c-jgy-070~~) topic.', example='Normal'),
      storageClass?: string(name='StorageClass', description='The storage class of the audio or video file. Valid values:

*   **Standard**: All media resources are stored as Standard objects.
*   **IA**: All media resources are stored as IA objects.
*   **Archive**: All media resources are stored as Archive objects.
*   **ColdArchive**: All media resources are stored as Cold Archive objects.
*   **SourceIA**: Only the source files are IA objects.
*   **SourceArchive**: Only the source files are Archive objects.
*   **SourceColdArchive**: Only the source files are Cold Archive objects.
*   **Changing**: The storage class of the audio or video file is being changed.
*   **SourceChanging**: The storage class of the source file is being changed.', example='Standard'),
      storageLocation?: string(name='StorageLocation', description='The storage address of the audio or video file.', example='out-****.oss-cn-shanghai.aliyuncs.com'),
      tags?: string(name='Tags', description='The tags of the audio or video file. Multiple tags are separated by commas (,).', example='Tag 1,Tag 2'),
      title?: string(name='Title', description='The title of the audio or video file.', example='Video title in ApsaraVideo VOD'),
      userData?: string(name='UserData'),
      videoId?: string(name='VideoId', description='The ID of the audio or video file.', example='9ae2af636ca6c10412f44891fc****'),
    }
  ](name='Video')
  }(name='VideoList', description='The information about the audio or video files. Information about a maximum of 5,000 audio or video files can be returned.'),
}

model GetVideoListResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: GetVideoListResponseBody(name='body'),
}

/**
 * @summary Queries information about media files.
 *
 * @description You can call this operation to query information about media files based on the filter conditions that you specify, such as video status and category ID. Information about a maximum of **5,000** media files can be returned for each request. We recommend that you set the StartTime and EndTime parameters to specify a time range for each request. For more information about how to query information about more media files or even all media files, see [SearchMedia](https://help.aliyun.com/document_detail/86044.html).
 *
 * @param request GetVideoListRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return GetVideoListResponse
 */
async function getVideoListWithOptions(request: GetVideoListRequest, runtime: $RuntimeOptions): GetVideoListResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.cateId)) {
    query['CateId'] = request.cateId;
  }
  if (!$isNull(request.endTime)) {
    query['EndTime'] = request.endTime;
  }
  if (!$isNull(request.pageNo)) {
    query['PageNo'] = request.pageNo;
  }
  if (!$isNull(request.pageSize)) {
    query['PageSize'] = request.pageSize;
  }
  if (!$isNull(request.sortBy)) {
    query['SortBy'] = request.sortBy;
  }
  if (!$isNull(request.startTime)) {
    query['StartTime'] = request.startTime;
  }
  if (!$isNull(request.status)) {
    query['Status'] = request.status;
  }
  if (!$isNull(request.storageLocation)) {
    query['StorageLocation'] = request.storageLocation;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'GetVideoList',
    version = '2017-03-21',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Queries information about media files.
 *
 * @description You can call this operation to query information about media files based on the filter conditions that you specify, such as video status and category ID. Information about a maximum of **5,000** media files can be returned for each request. We recommend that you set the StartTime and EndTime parameters to specify a time range for each request. For more information about how to query information about more media files or even all media files, see [SearchMedia](https://help.aliyun.com/document_detail/86044.html).
 *
 * @param request GetVideoListRequest
 * @return GetVideoListResponse
 */
async function getVideoList(request: GetVideoListRequest): GetVideoListResponse {
  var runtime = new $RuntimeOptions{};
  return getVideoListWithOptions(request, runtime);
}

model GetVideoPlayAuthRequest {
  apiVersion?: string(name='ApiVersion', description='The API version. Set the value to **1.0.0**.', example='1.0.0'),
  authInfoTimeout?: long(name='AuthInfoTimeout', description='The validity period of the playback credential. Unit: **seconds**. You cannot obtain the playback URL of a video by using a credential that has expired. A new credential is required.

*   Default value: **100**.
*   Valid values: `[100,3000]`.', example='100'),
  videoId?: string(name='VideoId', description='The ID of the media file. You can specify only one ID. You can use one of the following methods to obtain the ID of the file:

*   Log on to the [ApsaraVideo VOD](https://vod.console.aliyun.com) console. In the left-side navigation pane, choose **Media Files** > **Audio/Video**. On the Video and Audio page, view the ID of the media file. This method is applicable to files that are uploaded by using the ApsaraVideo VOD console.
*   Obtain the value of the VideoId parameter from the response to the [CreateUploadVideo](https://help.aliyun.com/document_detail/55407.html) operation.
*   Obtain the value of the VideoId parameter from the response to the [SearchMedia](https://help.aliyun.com/document_detail/86044.html) operation. This method is applicable to files that have been uploaded.

This parameter is required.', example='dfde02284a5c46622a097adaf44a****'),
}

model GetVideoPlayAuthResponseBody = {
  playAuth?: string(name='PlayAuth', description='The credential for media playback.', example='sstyYuew6789000000xtt7TYUh****'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='E4EBD2BF-5EB0-4476-8829-9D94E1B1****'),
  videoMeta?: {
    coverURL?: string(name='CoverURL', description='The thumbnail URL of the media file.', example='https://example.aliyundoc.com/****.jpg'),
    duration?: float(name='Duration', description='The duration of the media file. Unit: seconds.', example='120.0'),
    status?: string(name='Status', description='The status of the media file. For more information about the value range and description, see [Status: the status of a video](~~52839#title-vqg-8cz-7p8~~).', example='Normal'),
    title?: string(name='Title', description='The title of the media file.', example='VOD'),
    videoId?: string(name='VideoId', description='The ID of the media file.', example='dfde02284a5c46622a097adaf44a****'),
  }(name='VideoMeta', description='The metadata of the audio or video file.'),
}

model GetVideoPlayAuthResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: GetVideoPlayAuthResponseBody(name='body'),
}

/**
 * @summary Queries the credential required for media playback. ApsaraVideo Player SDK automatically obtains the playback URL based on the playback credential. Each playback credential can be used to obtain the playback URL only for a specific video in a specific period of time. You cannot obtain the playback URL if the credential expires or is incorrect. You can use PlayAuth-based playback when you require high security for audio and video playback.
 *
 * @description *   You can call this operation to obtain a playback credential when you use ApsaraVideo Player SDK to play a media file based on PlayAuth. The credential is used to obtain the playback URL. For more information, see [ApsaraVideo Player SDK](https://help.aliyun.com/document_detail/125579.html).
 * *   You cannot obtain the playback URL of a video by using a credential that has expired. A new credential is required.
 *
 * @param request GetVideoPlayAuthRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return GetVideoPlayAuthResponse
 */
async function getVideoPlayAuthWithOptions(request: GetVideoPlayAuthRequest, runtime: $RuntimeOptions): GetVideoPlayAuthResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.apiVersion)) {
    query['ApiVersion'] = request.apiVersion;
  }
  if (!$isNull(request.authInfoTimeout)) {
    query['AuthInfoTimeout'] = request.authInfoTimeout;
  }
  if (!$isNull(request.videoId)) {
    query['VideoId'] = request.videoId;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'GetVideoPlayAuth',
    version = '2017-03-21',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Queries the credential required for media playback. ApsaraVideo Player SDK automatically obtains the playback URL based on the playback credential. Each playback credential can be used to obtain the playback URL only for a specific video in a specific period of time. You cannot obtain the playback URL if the credential expires or is incorrect. You can use PlayAuth-based playback when you require high security for audio and video playback.
 *
 * @description *   You can call this operation to obtain a playback credential when you use ApsaraVideo Player SDK to play a media file based on PlayAuth. The credential is used to obtain the playback URL. For more information, see [ApsaraVideo Player SDK](https://help.aliyun.com/document_detail/125579.html).
 * *   You cannot obtain the playback URL of a video by using a credential that has expired. A new credential is required.
 *
 * @param request GetVideoPlayAuthRequest
 * @return GetVideoPlayAuthResponse
 */
async function getVideoPlayAuth(request: GetVideoPlayAuthRequest): GetVideoPlayAuthResponse {
  var runtime = new $RuntimeOptions{};
  return getVideoPlayAuthWithOptions(request, runtime);
}

model GetVodTemplateRequest {
  vodTemplateId?: string(name='VodTemplateId', description='The ID of the snapshot template.

This parameter is required.', example='7c49f2f4c0969*****fcd446690'),
}

model GetVodTemplateResponseBody = {
  requestId?: string(name='RequestId', description='The ID of the request.', example='DE7A1F49-41C1-47*****DF-4CD0C02087DB'),
  vodTemplateInfo?: {
    creationTime?: string(name='CreationTime', description='The time when the template was created. The time follows the ISO 8601 standard in the *yyyy-MM-dd*T*HH:mm:ss*Z format. The time is displayed in UTC.', example='2018-11-30T08:05:59:57Z'),
    isDefault?: string(name='IsDefault', description='Indicates whether the template is the default one. Valid values:

*   **Default**: The template is the default one.
*   **NotDefault**: The template is not the default one.', example='NotDefault'),
    modifyTime?: string(name='ModifyTime', description='The time when the template was modified. The time follows the ISO 8601 standard in the *yyyy-MM-dd*T*HH:mm:ss*Z format. The time is displayed in UTC.', example='2018-11-30T09:05:59:57Z'),
    name?: string(name='Name', description='The name of the template.', example='test'),
    templateConfig?: string(name='TemplateConfig', description='The detailed configurations of the template. The value is a JSON-formatted string. For more information about the data structure, see the "SnapshotTemplateConfig" section of the [Media processing parameters](https://help.aliyun.com/document_detail/98618.html) topic.', example='{\\\\"SnapshotConfig\\\\":{\\\\"Count\\\\":10,\\\\"SpecifiedOffsetTime\\\\":0,\\\\"Interval\\\\":1},\\\\"SnapshotType\\\\":\\\\"NormalSnapshot\\\\"}'),
    templateType?: string(name='TemplateType', description='The type of the template. Valid values:

*   **Snapshot**
*   **DynamicImage**', example='Snapshot'),
    vodTemplateId?: string(name='VodTemplateId', description='The ID of the template.', example='7c49f2f4c09*****69fcd446690'),
  }(name='VodTemplateInfo', description='The information about the snapshot template.'),
}

model GetVodTemplateResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: GetVodTemplateResponseBody(name='body'),
}

/**
 * @summary Queries a single snapshot template.
 *
 * @param request GetVodTemplateRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return GetVodTemplateResponse
 */
async function getVodTemplateWithOptions(request: GetVodTemplateRequest, runtime: $RuntimeOptions): GetVodTemplateResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.vodTemplateId)) {
    query['VodTemplateId'] = request.vodTemplateId;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'GetVodTemplate',
    version = '2017-03-21',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Queries a single snapshot template.
 *
 * @param request GetVodTemplateRequest
 * @return GetVodTemplateResponse
 */
async function getVodTemplate(request: GetVodTemplateRequest): GetVodTemplateResponse {
  var runtime = new $RuntimeOptions{};
  return getVodTemplateWithOptions(request, runtime);
}

model GetWatermarkRequest {
  watermarkId?: string(name='WatermarkId', description='The ID of the watermark template. You can specify only one watermark template ID. You can obtain the ID by using one of the following methods:

*   Obtain the watermark template ID from the response to the [AddWatermark](~~AddWatermark~~) operation that you call to create a watermark template.
*   Obtain the watermark template ID from the response to the [ListWatermark](~~ListWatermark~~) operation that you call to query all watermarks within your account.

This parameter is required.', example='9bcc8bfadb843f*****09a2671d0df97'),
}

model GetWatermarkResponseBody = {
  requestId?: string(name='RequestId', description='The ID of the request.', example='25818875-5F78-4A*****F6-D7393642CA58'),
  watermarkInfo?: {
    appId?: string(name='AppId', description='The ID of the application.', example='app-****'),
    creationTime?: string(name='CreationTime', description='The time when the watermark template was created. The time follows the ISO 8601 standard in the *yyyy-MM-dd*T*HH:mm:ss*Z format. The time is displayed in UTC.', example='2018-11-06T08:03:17Z'),
    fileUrl?: string(name='FileUrl', description='The URL of the watermark file. The URL is an Object Storage Service (OSS) URL or an Alibaba Cloud CDN URL.

>  This parameter is returned only for image watermark templates.', example='https://outin-32*****f4b3e7.oss-cn-shanghai.aliyuncs.com/image/cover/F85529C8B715E6F8A72EC6B-6-2.png?Expires=1541600583&OSSAccessKeyId=****&Signature=gmf1eYMoDVg%2BHQCb4UGozBW****'),
    isDefault?: string(name='IsDefault', description='Indicates whether the watermark template is the default one. Valid values:

*   **Default**
*   **NotDefault**', example='NotDefault'),
    name?: string(name='Name', description='The name of the watermark template.', example='image watermark test'),
    type?: string(name='Type', description='The type of the watermark template. Valid values:

*   **Image**: image watermark template
*   **Text**: text watermark template', example='Text'),
    watermarkConfig?: string(name='WatermarkConfig', description='The configuration information of the watermark such as the display position and special effects. The value is a JSON string. The configuration parameters for image and text watermarks are different. For more information about the parameter structure, see [WatermarkConfig](~~98618#section-h01-44s-2lr~~).', example='{"ReferPos": "BottomRight","Height": "55","Width": "55","Dx": "8","Dy": "8" }'),
    watermarkId?: string(name='WatermarkId', description='The ID of the watermark template.', example='505e2e287ea*****ecfddd386d384'),
  }(name='WatermarkInfo', description='The information about the watermark template.'),
}

model GetWatermarkResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: GetWatermarkResponseBody(name='body'),
}

/**
 * @summary Queries the information about an image or text watermark based on the watermark template ID. You can call this operation to obtain information such as the position, size, and display time of an image watermark or the content, position, font, and font color of a text watermark.
 *
 * @param request GetWatermarkRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return GetWatermarkResponse
 */
async function getWatermarkWithOptions(request: GetWatermarkRequest, runtime: $RuntimeOptions): GetWatermarkResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.watermarkId)) {
    query['WatermarkId'] = request.watermarkId;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'GetWatermark',
    version = '2017-03-21',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Queries the information about an image or text watermark based on the watermark template ID. You can call this operation to obtain information such as the position, size, and display time of an image watermark or the content, position, font, and font color of a text watermark.
 *
 * @param request GetWatermarkRequest
 * @return GetWatermarkResponse
 */
async function getWatermark(request: GetWatermarkRequest): GetWatermarkResponse {
  var runtime = new $RuntimeOptions{};
  return getWatermarkWithOptions(request, runtime);
}

model ListAIImageInfoRequest {
  videoId?: string(name='VideoId', description='The ID of the video. You can use one of the following methods to obtain the ID:

*   Log on to the [ApsaraVideo VOD](https://vod.console.aliyun.com) console. In the left-side navigation pane, choose **Media Files** > **Audio/Video**. On the Video and Audio page, view the ID of the audio or video file. This method is applicable to files that are uploaded by using the ApsaraVideo VOD console.
*   Obtain the value of VideoId from the response to the [CreateUploadVideo](https://help.aliyun.com/document_detail/55407.html) operation that you call to upload media files.
*   Obtain the value of VideoId from the response to the [SearchMedia](https://help.aliyun.com/document_detail/86044.html) operation after you upload media files.

This parameter is required.', example='357a8748c5789d2726e6436aa****'),
}

model ListAIImageInfoResponseBody = {
  AIImageInfoList?: [ 
    {
      AIImageInfoId?: string(name='AIImageInfoId', description='The ID of the image information.', example='b89a6aabf1b6197ebd6fe6cf29****'),
      creationTime?: string(name='CreationTime', description='The time when the file was created. The time follows the ISO 8601 standard in the *yyyy-MM-dd*T*HH:mm:ss*Z format. The time is displayed in UTC.', example='2020-10-15T03:30:03Z'),
      fileURL?: string(name='FileURL', description='The URL of the image file.'),
      format?: string(name='Format', description='The format of the image. Valid values: **gif** and **png**.', example='gif'),
      jobId?: string(name='JobId', description='The ID of the image AI processing job.', example='cf08a2c6e11ee1711b738b9067****'),
      score?: string(name='Score', description='The score of the image.', example='5.035636554444242'),
      version?: string(name='Version', description='The data version ID.', example='b547f3f0e199c3b457369f3cf****'),
      videoId?: string(name='VideoId', description='The ID of the video.', example='357a8748c5789d2726e6436aa****'),
    }
  ](name='AIImageInfoList', description='The image files that are uploaded for AI processing.'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='D73420CD-D221-9122-5B8FA995A511****'),
}

model ListAIImageInfoResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ListAIImageInfoResponseBody(name='body'),
}

/**
 * @summary Queries the AI processing results about the images of a specified video.
 *
 * @description *   Regions that support this operation: **China (Beijing)** and **China (Shanghai)**.
 * *   You can call this operation to query AI processing results about images of a specified video. Images of different videos cannot be queried in one request.
 *
 * @param request ListAIImageInfoRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ListAIImageInfoResponse
 */
async function listAIImageInfoWithOptions(request: ListAIImageInfoRequest, runtime: $RuntimeOptions): ListAIImageInfoResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.videoId)) {
    query['VideoId'] = request.videoId;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'ListAIImageInfo',
    version = '2017-03-21',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Queries the AI processing results about the images of a specified video.
 *
 * @description *   Regions that support this operation: **China (Beijing)** and **China (Shanghai)**.
 * *   You can call this operation to query AI processing results about images of a specified video. Images of different videos cannot be queried in one request.
 *
 * @param request ListAIImageInfoRequest
 * @return ListAIImageInfoResponse
 */
async function listAIImageInfo(request: ListAIImageInfoRequest): ListAIImageInfoResponse {
  var runtime = new $RuntimeOptions{};
  return listAIImageInfoWithOptions(request, runtime);
}

model ListAIJobRequest {
  jobIds?: string(name='JobIds', description='The list of job IDs. You can obtain the job ID from the PlayInfo parameter in the response to the [GetPlayInfo](https://help.aliyun.com/document_detail/56124.html) operation.

>  You can specify a maximum of 10 job IDs in a request. Separate multiple IDs with commas (,).

This parameter is required.', example='a718a3a1e8bb42ee3bc88921e94****,aasdcsfg782740asd3****,k2l3ibaskod98wrns9d****'),
  ownerAccount?: string(name='OwnerAccount'),
  ownerId?: string(name='OwnerId'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: string(name='ResourceOwnerId'),
}

model ListAIJobResponseBody = {
  AIJobList?: {
    AIJob?: [ 
    {
      code?: string(name='Code', description='The error code. This parameter is returned if the value of Status is fail.', example='0'),
      completeTime?: string(name='CompleteTime', description='The time when the job was complete. The time follows the ISO 8601 standard in the *yyyy-MM-dd*T*HH:mm:ss*Z format. The time is displayed in UTC.', example='2020-06-28T02:04:47Z'),
      creationTime?: string(name='CreationTime', description='The time when the job was created. The time follows the ISO 8601 standard in the *yyyy-MM-dd*T*HH:mm:ss*Z format. The time is displayed in UTC.', example='2020-06-28T02:04:32Z'),
      data?: string(name='Data', description='The returned data. The value is a JSON string. For more information, see [AITemplateConfig](https://help.aliyun.com/document_detail/89863.html).', example='{"OrigASRData":{"AsrTextList":[{"EndTime":700,"StartTime":0,"Text":"Yes.","ChannelId":0,"SpeechRate":85},{"EndTime":3750,"StartTime":1630,"Text":"No.","ChannelId":0,"SpeechRate":28},{"EndTime":5910,"StartTime":4020,"Text":"Of course.","ChannelId":0,"SpeechRate":95},{"EndTime":12750,"StartTime":10090,"Text":"Message.","ChannelId":0,"SpeechRate":45},{"EndTime":25230,"StartTime":13590,"Text":"Hello, good afternoon.","ChannelId":0,"SpeechRate":20},{"EndTime":30000,"StartTime":28220,"Text":"Yes.","ChannelId":0,"SpeechRate":33}],"Duration":"30016"}}'),
      jobId?: string(name='JobId', description='The job ID.', example='a718a3a1e8bb42ee3bc88921e94****'),
      mediaId?: string(name='MediaId', description='The ID of the video file.', example='3D3D12340d9401fab46a0b847****'),
      message?: string(name='Message', description='The error message. This parameter is returned if the value of Status is fail.', example='OK'),
      status?: string(name='Status', description='The status of the job. Valid values:

*   **success**: The job is successful.
*   **fail**: The job failed.
*   **init**: The job is being initialized.
*   **Processing**: The job is in progress.', example='success'),
      type?: string(name='Type', description='The type of the job. Valid values:

*   **AIMediaDNA**: video fingerprinting
*   **AIVideoTag**: smart tagging', example='AIVideoTag'),
    }
  ](name='AIJob')
  }(name='AIJobList', description='The list of jobs.'),
  nonExistAIJobIds?: {
    string?: [ string ](name='String')
  }(name='NonExistAIJobIds', description='The IDs of the jobs that do not exist.'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='8233A0E4-E112-44*****58-2BCED1B88173'),
}

model ListAIJobResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ListAIJobResponseBody(name='body'),
}

/**
 * @summary Queries AI jobs. After a job is submitted, ApsaraVideo VOD asynchronously processes the job. You can call this operation to query the job information in real time.
 *
 * @description *   Regions that support this operation: **China (Beijing)**, **China (Shanghai)**, and **Singapore**.
 * *   You can call this operation to query video fingerprinting jobs and smart tagging jobs.
 *
 * @param request ListAIJobRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ListAIJobResponse
 */
async function listAIJobWithOptions(request: ListAIJobRequest, runtime: $RuntimeOptions): ListAIJobResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.jobIds)) {
    query['JobIds'] = request.jobIds;
  }
  if (!$isNull(request.ownerAccount)) {
    query['OwnerAccount'] = request.ownerAccount;
  }
  if (!$isNull(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!$isNull(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!$isNull(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'ListAIJob',
    version = '2017-03-21',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Queries AI jobs. After a job is submitted, ApsaraVideo VOD asynchronously processes the job. You can call this operation to query the job information in real time.
 *
 * @description *   Regions that support this operation: **China (Beijing)**, **China (Shanghai)**, and **Singapore**.
 * *   You can call this operation to query video fingerprinting jobs and smart tagging jobs.
 *
 * @param request ListAIJobRequest
 * @return ListAIJobResponse
 */
async function listAIJob(request: ListAIJobRequest): ListAIJobResponse {
  var runtime = new $RuntimeOptions{};
  return listAIJobWithOptions(request, runtime);
}

model ListAITemplateRequest {
  templateType?: string(name='TemplateType', description='The type of the AI template. Valid values:

*   **AIMediaAudit**: automated review
*   **AIImage**: smart thumbnail

This parameter is required.', example='AIMediaAudit'),
}

model ListAITemplateResponseBody = {
  requestId?: string(name='RequestId', description='The ID of the request.', example='75B7BC67-FB8C-4653-4788-F4B01ED2****'),
  templateInfoList?: [ 
    {
      creationTime?: string(name='CreationTime', description='The time when the AI template was created. The time follows the ISO 8601 standard in the *yyyy-MM-dd*T*HH:mm:ss*Z format. The time is displayed in UTC.', example='2020-07-08T06:50:45Z'),
      isDefault?: string(name='IsDefault', description='Indicates whether the template is the default AI template. Valid values:

*   **Default**
*   **NotDefault**', example='NoDefault'),
      modifyTime?: string(name='ModifyTime', description='The time when the AI template was modified. The time follows the ISO 8601 standard in the *yyyy-MM-dd*T*HH:mm:ss*Z format. The time is displayed in UTC.', example='2020-07-08T06:58:45Z'),
      source?: string(name='Source', description='The source of the AI template. Valid values:

*   **System**
*   **Custom**', example='Custom'),
      templateConfig?: string(name='TemplateConfig', description='The detailed configurations of the AI template. The value is a JSON string. For more information, see [AITemplateConfig](~~89863#title-vd3-499-o36~~).', example='{"AuditRange":["text-title","video"],"AuditContent":["screen"],"AuditItem":["terrorism","porn"],"AuditAutoBlock":"yes"}'),
      templateId?: string(name='TemplateId', description='The ID of the AI template.', example='1706a0063dd733f6a823ef32e0a5****'),
      templateName?: string(name='TemplateName', description='The name of the AI template.', example='DemoAITemplate'),
      templateType?: string(name='TemplateType', description='The type of the AI template. Valid values:

*   **AIMediaAudit**: automated review
*   **AIImage**: smart thumbnail', example='AIMediaAudit'),
    }
  ](name='TemplateInfoList', description='The information about the AI templates.'),
}

model ListAITemplateResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ListAITemplateResponseBody(name='body'),
}

/**
 * @summary Queries AI templates.
 *
 * @description *   Regions that support this operation: **China (Beijing)**, **China (Shanghai)**, and **Singapore**.
 * *   You can call this operation to query AI templates of a specified type.
 *
 * @param request ListAITemplateRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ListAITemplateResponse
 */
async function listAITemplateWithOptions(request: ListAITemplateRequest, runtime: $RuntimeOptions): ListAITemplateResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.templateType)) {
    query['TemplateType'] = request.templateType;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'ListAITemplate',
    version = '2017-03-21',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Queries AI templates.
 *
 * @description *   Regions that support this operation: **China (Beijing)**, **China (Shanghai)**, and **Singapore**.
 * *   You can call this operation to query AI templates of a specified type.
 *
 * @param request ListAITemplateRequest
 * @return ListAITemplateResponse
 */
async function listAITemplate(request: ListAITemplateRequest): ListAITemplateResponse {
  var runtime = new $RuntimeOptions{};
  return listAITemplateWithOptions(request, runtime);
}

model ListAppInfoRequest {
  pageNo?: int32(name='PageNo', description='The page number. Default value: **1**.', example='1'),
  pageSize?: int32(name='PageSize', description='The number of entries per page. Default value: **10**. Maximum value: **100**.', example='10'),
  resourceGroupId?: string(name='ResourceGroupId', description='The resource group ID to which the instance belongs.', example='rg-aekzko7fsuj****'),
  status?: string(name='Status', description='The status of the application. You can specify the status of the applications that you want to query. After an application is created, it enters the **Normal** state. Valid values:

*   **Normal**
*   **Disable**', example='Normal'),
}

model ListAppInfoResponseBody = {
  appInfoList?: [ 
    {
      appId?: string(name='AppId', description='The ID of the application.', example='app-****'),
      appName?: string(name='AppName', description='The name of the application.', example='test'),
      creationTime?: string(name='CreationTime', description='The time when the application was created. The time follows the ISO 8601 standard in the *yyyy-MM-dd*T*HH:mm:ss*Z format. The time is displayed in UTC.', example='2019-03-01T08:00:00Z'),
      description?: string(name='Description', description='The description of the application.', example='my first app.'),
      modificationTime?: string(name='ModificationTime', description='The last time when the application was modified. The time follows the ISO 8601 standard in the `yyyy-MM-ddTHH:mm:ssZ` format. The time is displayed in UTC.', example='2019-03-01T09:00:00Z'),
      regionId?: string(name='RegionId', description='The region.', example='cn-shanghai'),
      resourceGroupId?: string(name='ResourceGroupId', description='The ID of the resource group.', example='rg-aekzko7fsuj****'),
      status?: string(name='Status', description='The status of the application. Valid values:

*   **Normal**
*   **Disable**', example='Normal'),
      type?: string(name='Type', description='The type of the application. Valid values:

*   **System**
*   **Custom**', example='System'),
    }
  ](name='AppInfoList', description='The details of applications.'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='25818875-5F78-4A13-4D5C-D7393642****'),
  total?: int32(name='Total', description='The total number of entries returned.', example='10'),
}

model ListAppInfoResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ListAppInfoResponseBody(name='body'),
}

/**
 * @summary Queries the applications that you are authorized to manage based on query conditions.
 *
 * @description ### [](#)Usage notes
 * You can query applications based on states.
 * ### [](#qps-)QPS limit
 * You can call this operation up to 30 times per second per account. Requests that exceed this limit are dropped and you may experience service interruptions. We recommend that you take note of this limit when you call this operation. For more information, see [QPS limits on API operations](https://help.aliyun.com/document_detail/342790.html).
 *
 * @param request ListAppInfoRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ListAppInfoResponse
 */
async function listAppInfoWithOptions(request: ListAppInfoRequest, runtime: $RuntimeOptions): ListAppInfoResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.pageNo)) {
    query['PageNo'] = request.pageNo;
  }
  if (!$isNull(request.pageSize)) {
    query['PageSize'] = request.pageSize;
  }
  if (!$isNull(request.resourceGroupId)) {
    query['ResourceGroupId'] = request.resourceGroupId;
  }
  if (!$isNull(request.status)) {
    query['Status'] = request.status;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'ListAppInfo',
    version = '2017-03-21',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Queries the applications that you are authorized to manage based on query conditions.
 *
 * @description ### [](#)Usage notes
 * You can query applications based on states.
 * ### [](#qps-)QPS limit
 * You can call this operation up to 30 times per second per account. Requests that exceed this limit are dropped and you may experience service interruptions. We recommend that you take note of this limit when you call this operation. For more information, see [QPS limits on API operations](https://help.aliyun.com/document_detail/342790.html).
 *
 * @param request ListAppInfoRequest
 * @return ListAppInfoResponse
 */
async function listAppInfo(request: ListAppInfoRequest): ListAppInfoResponse {
  var runtime = new $RuntimeOptions{};
  return listAppInfoWithOptions(request, runtime);
}

model ListAppPoliciesForIdentityRequest {
  appId?: string(name='AppId', description='The ID of the application. Default value: **app-1000000**. For more information, see [Overview](https://help.aliyun.com/document_detail/113600.html).', example='app-****'),
  identityName?: string(name='IdentityName', description='The name of the identity.

*   Specifies the ID of the RAM user when the IdentityType parameter is set to RamUser.
*   Specifies the name of the RAM role when the IdentityType parameter is set to RamRole.', example='test****name'),
  identityType?: string(name='IdentityType', description='The type of the identity. Valid values:

*   **RamUser**: a RAM user.
*   **RamRole**: a RAM role.', example='RamUser'),
}

model ListAppPoliciesForIdentityResponseBody = {
  appPolicyList?: [ 
    {
      appId?: string(name='AppId', description='The ID of the application.', example='app-****'),
      creationTime?: string(name='CreationTime', description='The time when the application policy was created. The time follows the ISO 8601 standard in the *yyyy-MM-dd*T*HH:mm:ss*Z format. The time is displayed in UTC.', example='2019-01-01T01:01:01Z'),
      description?: string(name='Description', description='The description of the policy.', example='App full access permission'),
      modificationTime?: string(name='ModificationTime', description='The last time when the application policy was modified. The time follows the ISO 8601 standard in the *yyyy-MM-dd*T*HH:mm:ss*Z format. The time is displayed in UTC.', example='2019-01-01T01:08:01Z'),
      policyName?: string(name='PolicyName', description='The name of the policy.', example='VODAppFullAccess'),
      policyType?: string(name='PolicyType', description='The type of the policy. Valid values:

*   **System**
*   **Custom**', example='System'),
      policyValue?: string(name='PolicyValue', description='The content of the policy.', example='****'),
    }
  ](name='AppPolicyList', description='The details of each policy.

> A maximum of 100 entries can be returned.'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='C9F3E715-B3B8-4D*****27-3A70346F0E04'),
}

model ListAppPoliciesForIdentityResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ListAppPoliciesForIdentityResponseBody(name='body'),
}

/**
 * @summary Queries the application policies that are attached to the specified identity. The identity may be a RAM user or RAM role.
 *
 * @description > The IdentityType and IdentityName parameters take effect only when an identity assumes the application administrator role to call this operation. Otherwise, only application policies that are attached to the current identity are returned.
 *
 * @param request ListAppPoliciesForIdentityRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ListAppPoliciesForIdentityResponse
 */
async function listAppPoliciesForIdentityWithOptions(request: ListAppPoliciesForIdentityRequest, runtime: $RuntimeOptions): ListAppPoliciesForIdentityResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.appId)) {
    query['AppId'] = request.appId;
  }
  if (!$isNull(request.identityName)) {
    query['IdentityName'] = request.identityName;
  }
  if (!$isNull(request.identityType)) {
    query['IdentityType'] = request.identityType;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'ListAppPoliciesForIdentity',
    version = '2017-03-21',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Queries the application policies that are attached to the specified identity. The identity may be a RAM user or RAM role.
 *
 * @description > The IdentityType and IdentityName parameters take effect only when an identity assumes the application administrator role to call this operation. Otherwise, only application policies that are attached to the current identity are returned.
 *
 * @param request ListAppPoliciesForIdentityRequest
 * @return ListAppPoliciesForIdentityResponse
 */
async function listAppPoliciesForIdentity(request: ListAppPoliciesForIdentityRequest): ListAppPoliciesForIdentityResponse {
  var runtime = new $RuntimeOptions{};
  return listAppPoliciesForIdentityWithOptions(request, runtime);
}

model ListAuditSecurityIpRequest {
  securityGroupName?: string(name='SecurityGroupName', description='The name of the review security group in which you want to query IP addresses. If you do not specify this parameter, IP addresses in all review security groups are queried.', example='Default'),
}

model ListAuditSecurityIpResponseBody = {
  requestId?: string(name='RequestId', description='The request ID.', example='664BBD08-C7DB-4E*****73-9D0958D9A899'),
  securityIpList?: [ 
    {
      creationTime?: string(name='CreationTime', description='The time when the review security group was created. The time follows the ISO 8601 standard in the *yyyy-MM-dd*T*HH:mm:ss*Z format. The time is displayed in UTC.', example='2018-05-22T06:54:23Z'),
      ips?: string(name='Ips', description='The IP addresses in the review security group.', example='30.27.14.0/24,30.39.127.245'),
      modificationTime?: string(name='ModificationTime', description='The time when the review security group was last modified. The time follows the ISO 8601 standard in the *yyyy-MM-dd*T*HH:mm:ss*Z format. The time is displayed in UTC.', example='2018-05-22T06:55:14Z'),
      securityGroupName?: string(name='SecurityGroupName', description='The name of the review security group.', example='Default'),
    }
  ](name='SecurityIpList', description='The details of the review security group.'),
}

model ListAuditSecurityIpResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ListAuditSecurityIpResponseBody(name='body'),
}

/**
 * @summary Queries the IP addresses in a review security group.
 *
 * @param request ListAuditSecurityIpRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ListAuditSecurityIpResponse
 */
async function listAuditSecurityIpWithOptions(request: ListAuditSecurityIpRequest, runtime: $RuntimeOptions): ListAuditSecurityIpResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.securityGroupName)) {
    query['SecurityGroupName'] = request.securityGroupName;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'ListAuditSecurityIp',
    version = '2017-03-21',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Queries the IP addresses in a review security group.
 *
 * @param request ListAuditSecurityIpRequest
 * @return ListAuditSecurityIpResponse
 */
async function listAuditSecurityIp(request: ListAuditSecurityIpRequest): ListAuditSecurityIpResponse {
  var runtime = new $RuntimeOptions{};
  return listAuditSecurityIpWithOptions(request, runtime);
}

model ListDynamicImageRequest {
  videoId?: string(name='VideoId', description='The ID of the video.

This parameter is required.', example='2e114f1100590c3193918fd449a****'),
}

model ListDynamicImageResponseBody = {
  dynamicImageList?: [ 
    {
      creationTime?: string(name='CreationTime', description='The time when the animated sticker was created. The time follows the ISO 8601 standard in the *yyyy-MM-dd*T*HH:mm:ss*Z format. The time is displayed in UTC.', example='2020-07-28T02:01:06Z'),
      duration?: string(name='Duration', description='The duration of the animated sticker. Unit: seconds.', example='2'),
      dynamicImageId?: string(name='DynamicImageId', description='The ID of the animated sticker.', example='2b4e51df60323ef43d6e336ecf****'),
      fileSize?: string(name='FileSize', description='The size of the animated sticker file. Unit: byte.', example='119866'),
      fileURL?: string(name='FileURL', description='The URL of the animated sticker file.', example='https://example.aliyundoc.com/2e114f110059*****0c3193918fd449a/image/dynamic/2b4e51df60*****323ef43d6e336ecf.webp?auth_key=1597296785-0-0-4a48e85*****bd2bb358e0b3cade'),
      format?: string(name='Format', description='The format of the animated sticker. Valid values: gif and webp.', example='webp'),
      fps?: string(name='Fps', description='The frame rate of the animated sticker. Unit: frames per second.', example='10'),
      height?: string(name='Height', description='The height of the animated sticker. Unit: pixel.', example='360'),
      jobId?: string(name='JobId', description='The job ID for creating the animated sticker.', example='2bf4390af9e5491c09cc720ad****'),
      videoId?: string(name='VideoId', description='The ID of the video.', example='2e114f1100590c3193918fd449a****'),
      width?: string(name='Width', description='The width of the animated sticker. Unit: pixel.', example='640'),
    }
  ](name='DynamicImageList', description='The list of animated stickers.'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='570189B6-572E-4953-13B4278EE0D8****'),
}

model ListDynamicImageResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ListDynamicImageResponseBody(name='body'),
}

/**
 * @summary Queries the information about animated stickers of a video based on the video ID.
 *
 * @param request ListDynamicImageRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ListDynamicImageResponse
 */
async function listDynamicImageWithOptions(request: ListDynamicImageRequest, runtime: $RuntimeOptions): ListDynamicImageResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.videoId)) {
    query['VideoId'] = request.videoId;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'ListDynamicImage',
    version = '2017-03-21',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Queries the information about animated stickers of a video based on the video ID.
 *
 * @param request ListDynamicImageRequest
 * @return ListDynamicImageResponse
 */
async function listDynamicImage(request: ListDynamicImageRequest): ListDynamicImageResponse {
  var runtime = new $RuntimeOptions{};
  return listDynamicImageWithOptions(request, runtime);
}

model ListJobInfoRequest {
  jobType?: string(name='JobType', description='The type of the task. Valid values:

*   transcode
*   snapshot
*   ai

This parameter is required.', example='transcode'),
  mediaId?: string(name='MediaId', description='The ID of the media asset.

This parameter is required.', example='30e5d7**********bd900764de7c0102'),
}

model ListJobInfoResponseBody = {
  jobInfoList?: [ 
    {
      completeTime?: string(name='CompleteTime', description='The time when the task was complete.', example='2024-10-14T07:39:34Z'),
      createTime?: string(name='CreateTime', description='The time when the task was created. The time follows the ISO 8601 standard in the YYYY-MM-DDTHH:mm:ssZ format. The time is displayed in UTC.', example='2024-10-14T07:39:25Z'),
      jobId?: string(name='JobId', description='The ID of the task.', example='5c9dff751ba**********59d50a967f5'),
      status?: string(name='Status', description='The status of the task.', example='TranscodeSuccess'),
      userId?: long(name='UserId', description='The ID of the user who submitted the task.', example='139109*****84930'),
    }
  ](name='JobInfoList', description='The historical tasks of the last 6 months.'),
  jobType?: string(name='JobType', description='The type of the task. Valid values:

*   transcode
*   snapshot
*   ai', example='transcode'),
  mediaId?: string(name='MediaId', description='The ID of the media asset.', example='30e5d7**********bd900764de7c0102'),
  requestId?: string(name='RequestId', description='The request ID.', example='6708D849-F109-1A6C-AC91-************'),
}

model ListJobInfoResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ListJobInfoResponseBody(name='body'),
}

/**
 * @summary Queries historical tasks based on the media asset ID.
 *
 * @description ****
 * *   You can call the [GetJobDetail](https://apiworkbench.aliyun-inc.com/document/vod/2017-03-21/GetJobDetail?spm=openapi-amp.newDocPublishment.0.0.616a281fSegn0e) operation to query detailed information about the tasks.
 * *   You can call this operation to query only asynchronous tasks of the last six months. The types of tasks that you can query include transcoding tasks, snapshot tasks, and AI tasks.
 * **QPS limits**
 * You can call this operation up to 15 times per second per account. Requests that exceed this limit are dropped and you will experience service interruptions. We recommend that you take note of this limit when you call this operation. For more information, see [QPS limits](https://help.aliyun.com/document_detail/342790.html).
 *
 * @param request ListJobInfoRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ListJobInfoResponse
 */
async function listJobInfoWithOptions(request: ListJobInfoRequest, runtime: $RuntimeOptions): ListJobInfoResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.jobType)) {
    query['JobType'] = request.jobType;
  }
  if (!$isNull(request.mediaId)) {
    query['MediaId'] = request.mediaId;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'ListJobInfo',
    version = '2017-03-21',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Queries historical tasks based on the media asset ID.
 *
 * @description ****
 * *   You can call the [GetJobDetail](https://apiworkbench.aliyun-inc.com/document/vod/2017-03-21/GetJobDetail?spm=openapi-amp.newDocPublishment.0.0.616a281fSegn0e) operation to query detailed information about the tasks.
 * *   You can call this operation to query only asynchronous tasks of the last six months. The types of tasks that you can query include transcoding tasks, snapshot tasks, and AI tasks.
 * **QPS limits**
 * You can call this operation up to 15 times per second per account. Requests that exceed this limit are dropped and you will experience service interruptions. We recommend that you take note of this limit when you call this operation. For more information, see [QPS limits](https://help.aliyun.com/document_detail/342790.html).
 *
 * @param request ListJobInfoRequest
 * @return ListJobInfoResponse
 */
async function listJobInfo(request: ListJobInfoRequest): ListJobInfoResponse {
  var runtime = new $RuntimeOptions{};
  return listJobInfoWithOptions(request, runtime);
}

model ListLiveRecordVideoRequest {
  appName?: string(name='AppName', description='The name of the application that was used to record the live stream.', example='testApp'),
  domainName?: string(name='DomainName', description='The domain name of the recorded live stream.', example='example.aliyundoc.com'),
  endTime?: string(name='EndTime', description='The end of the time range to query. The query is performed based on the time range during which the required live streams were recorded. The end time must be later than the start time. Specify the time in the ISO 8601 standard in the *yyyy-MM-dd*T*HH:mm:ss*Z format. The time must be in UTC.', example='2017-01-11T13:00:00Z'),
  pageNo?: int32(name='PageNo', description='The number of the page to return. Default value: **1**.', example='1'),
  pageSize?: int32(name='PageSize', description='The number of entries to return on each page. Maximum value: **100**. Default value: **10**.', example='10'),
  sortBy?: string(name='SortBy', description='The sorting rule of the results. Valid values:

*   **CreationTime:Desc**: The results are sorted in reverse chronological order based on the creation time.
*   **CreationTime:Asc**: The results are sorted in chronological order based on the creation time.', example='CreationTime:Desc'),
  startTime?: string(name='StartTime', description='The beginning of the time range to query. The query is performed based on the time range during which the required live streams were recorded. Specify the time in the ISO 8601 standard in the *yyyy-MM-dd*T*HH:mm:ss*Z format. The time must be in UTC.', example='2017-01-11T12:00:00Z'),
  streamName?: string(name='StreamName', description='The name of the recorded live stream.', example='live-test'),
}

model ListLiveRecordVideoResponseBody = {
  liveRecordVideoList?: {
    liveRecordVideo?: [ 
    {
      appName?: string(name='AppName', description='The name of the app.', example='testApp'),
      domainName?: string(name='DomainName', description='The domain name.', example='example.com'),
      playlistId?: string(name='PlaylistId', description='The ID of the playlist.', example='****'),
      recordEndTime?: string(name='RecordEndTime', description='The recording end time. The time is in the *yyyy-MM-dd*T*HH:mm:ss*Z format. The time is displayed in UTC.', example='2017-12-08T08:44:56Z'),
      recordStartTime?: string(name='RecordStartTime', description='The recording start time. The time is in the *yyyy-MM-dd*T*HH:mm:ss*Z format. The time is displayed in UTC.', example='2017-12-08T07:40:56Z'),
      streamName?: string(name='StreamName', description='The name of the live-to-VOD file.', example='live-test'),
      video?: {
        cateId?: int32(name='CateId', description='The ID of the video category.', example='78'),
        cateName?: string(name='CateName', description='The category of the video.', example='Category name'),
        coverURL?: string(name='CoverURL', description='The URL of the video thumbnail.', example='https://example.aliyundoc.com/coversample.jpg'),
        creationTime?: string(name='CreationTime', description='The time when the audio or video file was created. The time is in the *yyyy-MM-dd*T*HH:mm:ss*Z format. The time is displayed in UTC.', example='2017-12-08T07:40:56Z'),
        description?: string(name='Description', description='The description of the video file.', example='Description of the ApsaraVideo VOD video'),
        duration?: float(name='Duration', description='The duration of the video file. Unit: seconds.', example='135.6'),
        modifyTime?: string(name='ModifyTime', description='The time when the video was updated. The time is in the *yyyy-MM-dd*T*HH:mm:ss*Z format. The time is displayed in UTC.', example='2017-12-08T09:40:56Z'),
        size?: long(name='Size', description='The size of the source video file. Unit: bytes.', example='10897890'),
        snapshots?: {
          snapshot?: [ string ](name='Snapshot')
        }(name='Snapshots', description='The array of video snapshot URLs.'),
        status?: string(name='Status', description='The status of the video. Valid values:

*   **Uploading**
*   **UploadFail**
*   **UploadSuccess**
*   **Transcoding**
*   **TranscodeFail**
*   **Blocked**
*   **Normal**: The video is normal.', example='Normal'),
        tags?: string(name='Tags', description='The tags of the video. Multiple tags are separated with commas (,).', example='tag1, tag2'),
        templateGroupId?: string(name='TemplateGroupId', description='The ID of the transcoding template group.', example='1'),
        title?: string(name='Title', description='The title of the video.', example='Title of the ApsaraVideo VOD video'),
        videoId?: string(name='VideoId', description='The ID of the video.', example='93ab850b4f6f*****54b6e91d24d81d4'),
      }(name='Video', description='The information about the live-to-VOD file.'),
    }
  ](name='LiveRecordVideo')
  }(name='LiveRecordVideoList', description='The list of videos.'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='25818875-5F78-4A13-****-D7393642CA58'),
  total?: int32(name='Total', description='The total number of videos.', example='123'),
}

model ListLiveRecordVideoResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ListLiveRecordVideoResponseBody(name='body'),
}

/**
 * @summary Queries live-to-VOD videos.
 *
 * @description You can query up to 5,000 videos based on the specified filter condition.
 *
 * @param request ListLiveRecordVideoRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ListLiveRecordVideoResponse
 */
async function listLiveRecordVideoWithOptions(request: ListLiveRecordVideoRequest, runtime: $RuntimeOptions): ListLiveRecordVideoResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.appName)) {
    query['AppName'] = request.appName;
  }
  if (!$isNull(request.domainName)) {
    query['DomainName'] = request.domainName;
  }
  if (!$isNull(request.endTime)) {
    query['EndTime'] = request.endTime;
  }
  if (!$isNull(request.pageNo)) {
    query['PageNo'] = request.pageNo;
  }
  if (!$isNull(request.pageSize)) {
    query['PageSize'] = request.pageSize;
  }
  if (!$isNull(request.sortBy)) {
    query['SortBy'] = request.sortBy;
  }
  if (!$isNull(request.startTime)) {
    query['StartTime'] = request.startTime;
  }
  if (!$isNull(request.streamName)) {
    query['StreamName'] = request.streamName;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'ListLiveRecordVideo',
    version = '2017-03-21',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Queries live-to-VOD videos.
 *
 * @description You can query up to 5,000 videos based on the specified filter condition.
 *
 * @param request ListLiveRecordVideoRequest
 * @return ListLiveRecordVideoResponse
 */
async function listLiveRecordVideo(request: ListLiveRecordVideoRequest): ListLiveRecordVideoResponse {
  var runtime = new $RuntimeOptions{};
  return listLiveRecordVideoWithOptions(request, runtime);
}

model ListSnapshotsRequest {
  authTimeout?: string(name='AuthTimeout', description='The validity period of the snapshot URL. Default value: **3600**. Minimum value: **3600**. Unit: seconds.

*   This parameter takes effect only when you enable URL signing. For more information, see [Configure URL signing](https://help.aliyun.com/document_detail/57007.html).
*   If you specify a value smaller than **3,600 seconds**, **3600** is used by default.
*   If the snapshot URL is an Object Storage Service (OSS) URL, the maximum value for this parameter is **2592000** (30 days). This reduces risks on the origin.', example='3600'),
  pageNo?: string(name='PageNo', description='The page number. Default value: **1**.', example='1'),
  pageSize?: string(name='PageSize', description='The number of entries per page. Default value: **20**. Maximum value: **100**.', example='20'),
  snapshotType?: string(name='SnapshotType', description='The type of snapshots to return. Valid values:

*   **CoverSnapshot**: thumbnail snapshot
*   **NormalSnapshot**: regular snapshot
*   **SpriteSnapshot**: sprite snapshot
*   **SpriteOriginSnapshot**: sprite source snapshot
*   **WebVttSnapshot**: WebVTT snapshot', example='CoverSnapshot'),
  videoId?: string(name='VideoId', description='The ID of the video. You can use one of the following methods to obtain the ID:

*   Log on to the [ApsaraVideo VOD console](https://vod.console.aliyun.com). In the left-side navigation pane, choose **Media Files** > **Audio/Video** to view the video ID.
*   Obtain the video ID from the response to the [CreateUploadVideo](~~CreateUploadVideo~~) operation that you call to obtain the upload URL and credential.
*   Obtain the video ID from the response to the [SearchMedia](~~SearchMedia~~) operation that you call to query videos.

This parameter is required.', example='d3e680e618708fbf2cae7cc931****'),
}

model ListSnapshotsResponseBody = {
  mediaSnapshot?: {
    creationTime?: string(name='CreationTime', description='The time when the snapshot job was created. The time follows the ISO 8601 standard in the *yyyy-MM-dd*T*HH:mm:ss*Z format. The time is displayed in UTC.', example='2017-12-20T12:23:45Z'),
    jobId?: string(name='JobId', description='The ID of the snapshot job.', example='ad90a501b1b9472374ad005046****'),
    regular?: string(name='Regular', description='The rule used to generate snapshot URLs.', example='http://example.aliyundoc.com/snapshot/sample{SnapshotCount}.jpg'),
    snapshots?: {
      snapshot?: [ 
      {
        index?: long(name='Index', description='The index of the snapshot.', example='1'),
        url?: string(name='Url', description='The URL of the snapshot.', example='http://example.aliyundoc.com/snapshot/sample00001****.jpg'),
      }
    ](name='Snapshot')
    }(name='Snapshots', description='The details of the snapshot.'),
    total?: long(name='Total', description='The total number of snapshots.', example='100'),
  }(name='MediaSnapshot', description='The information about the snapshot.'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='25818875-5F78-4AF6-D7393642CA58****'),
}

model ListSnapshotsResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ListSnapshotsResponseBody(name='body'),
}

/**
 * @summary Queries the snapshots that are captured by submitting snapshot jobs or snapshots that are generated by the system when you upload the video.
 *
 * @description If multiple snapshots exist for a video, you can call this operation to query information about the latest snapshot.
 *
 * @param request ListSnapshotsRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ListSnapshotsResponse
 */
async function listSnapshotsWithOptions(request: ListSnapshotsRequest, runtime: $RuntimeOptions): ListSnapshotsResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.authTimeout)) {
    query['AuthTimeout'] = request.authTimeout;
  }
  if (!$isNull(request.pageNo)) {
    query['PageNo'] = request.pageNo;
  }
  if (!$isNull(request.pageSize)) {
    query['PageSize'] = request.pageSize;
  }
  if (!$isNull(request.snapshotType)) {
    query['SnapshotType'] = request.snapshotType;
  }
  if (!$isNull(request.videoId)) {
    query['VideoId'] = request.videoId;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'ListSnapshots',
    version = '2017-03-21',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Queries the snapshots that are captured by submitting snapshot jobs or snapshots that are generated by the system when you upload the video.
 *
 * @description If multiple snapshots exist for a video, you can call this operation to query information about the latest snapshot.
 *
 * @param request ListSnapshotsRequest
 * @return ListSnapshotsResponse
 */
async function listSnapshots(request: ListSnapshotsRequest): ListSnapshotsResponse {
  var runtime = new $RuntimeOptions{};
  return listSnapshotsWithOptions(request, runtime);
}

model ListTranscodeTaskRequest {
  endTime?: string(name='EndTime', description='The end of the time range to query. The end time must be later than the start time. Specify the time in the ISO 8601 standard in the *yyyy-MM-dd*T*HH:mm:ss*Z format. The time must be in UTC.', example='2019-01-23T12:40:12Z'),
  pageNo?: int32(name='PageNo', description='The number of the page to return. You can specify a page number to return data from the specified page. Default value: **1**.', example='1'),
  pageSize?: int32(name='PageSize', description='The number of entries to return on each page. Maximum value: **50**. Default value: **10**.', example='10'),
  startTime?: string(name='StartTime', description='The beginning of the time range to query. Specify the time in the ISO 8601 standard in the *yyyy-MM-dd*T*HH:mm:ss*Z format. The time must be in UTC.', example='2019-01-23T12:35:12Z'),
  videoId?: string(name='VideoId', description='The ID of the audio or video file. You can use one of the following methods to obtain the ID of the file:
*   Log on to the [ApsaraVideo VOD](https://vod.console.aliyun.com) console. In the left-side navigation pane, choose **Media Files** > **Audio/Video**. On the Video and Audio page, view the ID of the audio or video file. This method is applicable to files that are uploaded by using the ApsaraVideo VOD console.
*   Obtain the value of VideoId from the response to the [CreateUploadVideo](https://help.aliyun.com/document_detail/55407.html) operation that you call to obtain the upload URL and credential.
*   Obtain the value of VideoId by calling the [SearchMedia](https://help.aliyun.com/document_detail/86044.html) operation. This method is applicable to files that have been uploaded.

This parameter is required.', example='d4860fcc6a5*****bce9fed52e893824'),
}

model ListTranscodeTaskResponseBody = {
  requestId?: string(name='RequestId', description='The ID of the request.', example='25818875-5F78-4A*****F6-D7393642CA58'),
  transcodeTaskList?: [ 
    {
      completeTime?: string(name='CompleteTime', description='The time when the transcoding task was complete. The time follows the ISO 8601 standard in the *yyyy-MM-dd*T*HH:mm:ss*Z format. The time is displayed in UTC.', example='2019-01-23T12:40:12Z'),
      creationTime?: string(name='CreationTime', description='The time when the transcoding task was created. The time follows the ISO 8601 standard in the *yyyy-MM-dd*T*HH:mm:ss*Z format. The time is displayed in UTC.', example='2019-01-23T12:35:12Z'),
      taskStatus?: string(name='TaskStatus', description='The status of the transcoding task. Valid values:
*   **Processing**: In progress.
*   **Partial**: Some transcoding jobs were complete.
*   **CompleteAllSucc**: All transcoding jobs were successful.
*   **CompleteAllFail**: All transcoding jobs failed. If an exception occurs in the source file, no transcoding job is initiated and the transcoding task fails.
*   **CompletePartialSucc**: All transcoding jobs were complete but only some were successful.', example='Processing'),
      transcodeTaskId?: string(name='TranscodeTaskId', description='The ID of the transcoding task.', example='b1b65ab107*****ba3dbb900f6c1fe0'),
      transcodeTemplateGroupId?: string(name='TranscodeTemplateGroupId', description='The ID of the transcoding template group.', example='b500c7094bd24*****f3e9900752d7c3'),
      trigger?: string(name='Trigger', description='The mode in which the transcoding task is triggered. Valid values:
*   **Auto**: The transcoding task is automatically triggered when the video is uploaded.
*   **Manual**: The transcoding task is triggered by calling the SubmitTranscodeJobs operation.', example='Auto'),
      videoId?: string(name='VideoId', description='The ID of the audio or video file.', example='d4860fcc6a5*****bce9fed52e893824'),
    }
  ](name='TranscodeTaskList', description='Details about transcoding tasks.'),
}

model ListTranscodeTaskResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ListTranscodeTaskResponseBody(name='body'),
}

/**
 * @summary Queries transcoding tasks based on the media ID. This operation does not return specific job information.
 *
 * @description *   You can call the [GetTranscodeTask](https://help.aliyun.com/document_detail/109121.html) operation to query details about transcoding jobs.
 * *   **You can call this operation to query only transcoding tasks created within the past year.**
 *
 * @param request ListTranscodeTaskRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ListTranscodeTaskResponse
 */
async function listTranscodeTaskWithOptions(request: ListTranscodeTaskRequest, runtime: $RuntimeOptions): ListTranscodeTaskResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.endTime)) {
    query['EndTime'] = request.endTime;
  }
  if (!$isNull(request.pageNo)) {
    query['PageNo'] = request.pageNo;
  }
  if (!$isNull(request.pageSize)) {
    query['PageSize'] = request.pageSize;
  }
  if (!$isNull(request.startTime)) {
    query['StartTime'] = request.startTime;
  }
  if (!$isNull(request.videoId)) {
    query['VideoId'] = request.videoId;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'ListTranscodeTask',
    version = '2017-03-21',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Queries transcoding tasks based on the media ID. This operation does not return specific job information.
 *
 * @description *   You can call the [GetTranscodeTask](https://help.aliyun.com/document_detail/109121.html) operation to query details about transcoding jobs.
 * *   **You can call this operation to query only transcoding tasks created within the past year.**
 *
 * @param request ListTranscodeTaskRequest
 * @return ListTranscodeTaskResponse
 */
async function listTranscodeTask(request: ListTranscodeTaskRequest): ListTranscodeTaskResponse {
  var runtime = new $RuntimeOptions{};
  return listTranscodeTaskWithOptions(request, runtime);
}

model ListTranscodeTemplateGroupRequest {
  appId?: string(name='AppId', description='The ID of the application. Default value: **app-1000000**. For more information, see [Overview](https://help.aliyun.com/document_detail/113600.html).', example='app-****'),
}

model ListTranscodeTemplateGroupResponseBody = {
  requestId?: string(name='RequestId', description='The ID of the request.', example='25818875-5F78-4A*****F6-D7393642CA58'),
  transcodeTemplateGroupList?: [ 
    {
      appId?: string(name='AppId', description='The ID of the application.', example='app-****'),
      creationTime?: string(name='CreationTime', description='The time when the template group was created. The time follows the ISO 8601 standard in the *yyyy-MM-dd*T*HH:mm:ss*Z format. The time is displayed in UTC.', example='2018-12-05T10:20:09Z'),
      isDefault?: string(name='IsDefault', description='Indicates whether the template group is the default one. Valid values:

*   **Default**: The template group is the default one.
*   **NotDefault**: The template group is not the default one.', example='Default'),
      locked?: string(name='Locked', description='The lock status of the transcoding template group. Valid values:

*   **Disabled**: The template group is not locked.
*   **Enabled**: The template group is locked.', example='Disabled'),
      modifyTime?: string(name='ModifyTime', description='The time when the template group was modified. The time follows the ISO 8601 standard in the *yyyy-MM-dd*T*HH:mm:ss*Z format. The time is displayed in UTC.', example='2018-12-05T10:22:09Z'),
      name?: string(name='Name', description='The name of the template group.', example='test'),
      transcodeTemplateGroupId?: string(name='TranscodeTemplateGroupId', description='The ID of the transcoding template group.', example='17a9889fc66852*****d791c886700932'),
    }
  ](name='TranscodeTemplateGroupList', description='The transcoding template groups.'),
}

model ListTranscodeTemplateGroupResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ListTranscodeTemplateGroupResponseBody(name='body'),
}

/**
 * @summary Queries transcoding template groups.
 *
 * @description > This operation does not return the configurations of transcoding templates in each transcoding template group. To query the configurations of transcoding templates in a specific transcoding template group, call the [GetTranscodeTemplateGroup](https://help.aliyun.com/document_detail/102670.html) operation.
 *
 * @param request ListTranscodeTemplateGroupRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ListTranscodeTemplateGroupResponse
 */
async function listTranscodeTemplateGroupWithOptions(request: ListTranscodeTemplateGroupRequest, runtime: $RuntimeOptions): ListTranscodeTemplateGroupResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.appId)) {
    query['AppId'] = request.appId;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'ListTranscodeTemplateGroup',
    version = '2017-03-21',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Queries transcoding template groups.
 *
 * @description > This operation does not return the configurations of transcoding templates in each transcoding template group. To query the configurations of transcoding templates in a specific transcoding template group, call the [GetTranscodeTemplateGroup](https://help.aliyun.com/document_detail/102670.html) operation.
 *
 * @param request ListTranscodeTemplateGroupRequest
 * @return ListTranscodeTemplateGroupResponse
 */
async function listTranscodeTemplateGroup(request: ListTranscodeTemplateGroupRequest): ListTranscodeTemplateGroupResponse {
  var runtime = new $RuntimeOptions{};
  return listTranscodeTemplateGroupWithOptions(request, runtime);
}

model ListVodTemplateRequest {
  appId?: string(name='AppId', description='The ID of the application. Set the value to **app-1000000**. For more information, see [Overview](https://help.aliyun.com/document_detail/113600.html).', example='app-****'),
  templateType?: string(name='TemplateType', description='The type of the template. Set the value to **Snapshot**.

This parameter is required.', example='Snapshot'),
}

model ListVodTemplateResponseBody = {
  requestId?: string(name='RequestId', description='The ID of the request.', example='2A56B75B-B7E6-48*****27-A9BEAA3E50A8'),
  vodTemplateInfoList?: [ 
    {
      appId?: string(name='AppId', description='The ID of the application.', example='app-****'),
      creationTime?: string(name='CreationTime', description='The time when the template was created. The time follows the ISO 8601 standard in the *yyyy-MM-dd*T*HH:mm:ss*Z format. The time is displayed in UTC.', example='2018-11-30T08:05:59:57Z'),
      isDefault?: string(name='IsDefault', description='Indicates whether the template is the default one. Valid values:

*   **Default**: The template is the default one.
*   **NotDefault**: The template is not the default one.', example='NotDefault'),
      modifyTime?: string(name='ModifyTime', description='The time when the template was modified. The time follows the ISO 8601 standard in the *yyyy-MM-dd*T*HH:mm:ss*Z format. The time is displayed in UTC.', example='2018-11-30T09:05:59:97Z'),
      name?: string(name='Name', description='The name of the template.', example='test'),
      templateConfig?: string(name='TemplateConfig', description='The detailed configurations of the template. The value is a JSON-formatted string. For more information about the data structure, see the "SnapshotTemplateConfig" section of the [Media processing parameters](https://help.aliyun.com/document_detail/98618.html) topic.', example='{\\\\"SnapshotConfig\\\\":{\\\\"Count\\\\":10,\\\\"SpecifiedOffsetTime\\\\":0,\\\\"Interval\\\\":1},\\\\"SnapshotType\\\\":\\\\"NormalSnapshot\\\\"}'),
      templateType?: string(name='TemplateType', description='The type of the template. Valid values:

*   **Snapshot**
*   **DynamicImage**', example='Snapshot'),
      vodTemplateId?: string(name='VodTemplateId', description='The ID of the template.', example='7c49f2f42b1c*****0969fcd446690'),
    }
  ](name='VodTemplateInfoList', description='The snapshot templates.'),
}

model ListVodTemplateResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ListVodTemplateResponseBody(name='body'),
}

/**
 * @summary Queries snapshot templates.
 *
 * @param request ListVodTemplateRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ListVodTemplateResponse
 */
async function listVodTemplateWithOptions(request: ListVodTemplateRequest, runtime: $RuntimeOptions): ListVodTemplateResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.appId)) {
    query['AppId'] = request.appId;
  }
  if (!$isNull(request.templateType)) {
    query['TemplateType'] = request.templateType;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'ListVodTemplate',
    version = '2017-03-21',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Queries snapshot templates.
 *
 * @param request ListVodTemplateRequest
 * @return ListVodTemplateResponse
 */
async function listVodTemplate(request: ListVodTemplateRequest): ListVodTemplateResponse {
  var runtime = new $RuntimeOptions{};
  return listVodTemplateWithOptions(request, runtime);
}

model ListWatermarkRequest {
  appId?: string(name='AppId', description='The ID of the application. Default value: **app-1000000**.

If you have activated the multi-application service, specify the ID of the application to query all image and text watermark templates in the specified application. If you leave this parameter empty, image and text watermark templates in all applications are queried. For more information, see [Overview](https://help.aliyun.com/document_detail/113600.html).', example='app-****'),
}

model ListWatermarkResponseBody = {
  requestId?: string(name='RequestId', description='The request ID.', example='25818875-5F78-4A*****F6-D7393642CA58'),
  watermarkInfos?: [ 
    {
      appId?: string(name='AppId', description='The ID of the application.', example='app-****'),
      creationTime?: string(name='CreationTime', description='The time when the watermark template was created. The time follows the ISO 8601 standard in the *yyyy-MM-dd*T*HH:mm:ss*Z format. The time is displayed in UTC.', example='2018-11-07T09:05:52Z'),
      fileUrl?: string(name='FileUrl', description='The URL of the watermark file. The URL is an Object Storage Service (OSS) URL or an Alibaba Cloud CDN URL.

>  This parameter is returned only for image watermark templates.', example='https://outin-3262681cd*****89f4b3e7.oss-cn-shanghai.aliyuncs.com/image/cover/8CC8B715E6F8A72EC6B-6-2.png?Expires=1541600583&OSSAccessKeyId=****&Signature=gmf1eYMoDVg%2BHQCb4UGozB****'),
      isDefault?: string(name='IsDefault', description='Indicates whether the watermark template is the default one. Valid values:

*   **Default**
*   **NotDefault**', example='NotDefault'),
      name?: string(name='Name', description='The name of the watermark template.', example='testName'),
      type?: string(name='Type', description='The type of the watermark template.

*   **Image**: image watermark template
*   **Text**: text watermark template', example='Text'),
      watermarkConfig?: string(name='WatermarkConfig', description='The configuration information of the watermark such as the display position and special effects. The value is a JSON string. The configuration parameters for image and text watermarks are different. For more information about the parameter structure, see [WatermarkConfig](~~98618#section-h01-44s-2lr~~).', example='{"FontColor": "Blue","FontSize": 80,"Content": "test watermark"}'),
      watermarkId?: string(name='WatermarkId', description='The ID of the watermark template.', example='9bcc8bfadb843*****109a2671d0df97'),
    }
  ](name='WatermarkInfos', description='The information about the watermark template.'),
}

model ListWatermarkResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ListWatermarkResponseBody(name='body'),
}

/**
 * @summary Queries the configuration information about all image and text watermark templates in a region. You can call this operation to obtain information such as the position, size, and display time of image watermarks or the content, position, font, and font color of text watermarks.
 *
 * @param request ListWatermarkRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ListWatermarkResponse
 */
async function listWatermarkWithOptions(request: ListWatermarkRequest, runtime: $RuntimeOptions): ListWatermarkResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.appId)) {
    query['AppId'] = request.appId;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'ListWatermark',
    version = '2017-03-21',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Queries the configuration information about all image and text watermark templates in a region. You can call this operation to obtain information such as the position, size, and display time of image watermarks or the content, position, font, and font color of text watermarks.
 *
 * @param request ListWatermarkRequest
 * @return ListWatermarkResponse
 */
async function listWatermark(request: ListWatermarkRequest): ListWatermarkResponse {
  var runtime = new $RuntimeOptions{};
  return listWatermarkWithOptions(request, runtime);
}

model MoveAppResourceRequest {
  resourceIds?: string(name='ResourceIds', description='The resource ID. You can specify a maximum of 20 IDs at a time. Separate multiple IDs with commas (,).

This parameter is required.', example='9afb4****06de180880e,f7bba****caa546cfe2ba'),
  resourceType?: string(name='ResourceType', description='The resource type. Valid values:

*   **video**: video files.
*   **image**: image files.
*   **attached**: auxiliary media assets.

This parameter is required.', example='video'),
  targetAppId?: string(name='TargetAppId', description='The ID of the application to which resources are migrated. Default value: **app-1000000**. For more information, see [Use the multi-application service](https://help.aliyun.com/document_detail/113600.html).

This parameter is required.', example='app-****'),
}

model MoveAppResourceResponseBody = {
  failedResourceIds?: [ string ](name='FailedResourceIds', description='The IDs of the resources that failed to be migrated.'),
  nonExistResourceIds?: [ string ](name='NonExistResourceIds', description='The IDs of the resources that were not found.'),
  requestId?: string(name='RequestId', description='The request ID.', example='25818875-5F78-4A13-BEF6-****'),
}

model MoveAppResourceResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: MoveAppResourceResponseBody(name='body'),
}

/**
 * @summary Migrates resources between applications. The application administrator can directly migrate resources between applications. Resource Access Management (RAM) users or RAM roles must obtain the write permissions on the source and destination applications before they migrate resources between applications. Multiple resources can be migrated at a time.
 *
 * @param request MoveAppResourceRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return MoveAppResourceResponse
 */
async function moveAppResourceWithOptions(request: MoveAppResourceRequest, runtime: $RuntimeOptions): MoveAppResourceResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.resourceIds)) {
    query['ResourceIds'] = request.resourceIds;
  }
  if (!$isNull(request.resourceType)) {
    query['ResourceType'] = request.resourceType;
  }
  if (!$isNull(request.targetAppId)) {
    query['TargetAppId'] = request.targetAppId;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'MoveAppResource',
    version = '2017-03-21',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Migrates resources between applications. The application administrator can directly migrate resources between applications. Resource Access Management (RAM) users or RAM roles must obtain the write permissions on the source and destination applications before they migrate resources between applications. Multiple resources can be migrated at a time.
 *
 * @param request MoveAppResourceRequest
 * @return MoveAppResourceResponse
 */
async function moveAppResource(request: MoveAppResourceRequest): MoveAppResourceResponse {
  var runtime = new $RuntimeOptions{};
  return moveAppResourceWithOptions(request, runtime);
}

model PreloadVodObjectCachesRequest {
  area?: string(name='Area', description='The acceleration region in which you want to prefetch content. If you do not specify a region, the value overseas is used.

*   **domestic**: Chinese mainland
*   **overseas**: outside the Chinese mainland', example='domestic'),
  l2Preload?: boolean(name='L2Preload', description='Specifies whether to prefetch content to POPs. Valid values:

*   **true**: prefetches content to nodes that include L2 DCDN nodes.
*   **false**: prefetches content to L2 POPs or L3 POPs.', example='true'),
  objectPath?: string(name='ObjectPath', description='The URL of the file to be prefetched. Separate multiple URLs with line breaks (\\\\n or \\\\r\\\\n).

This parameter is required.', example='vod.test.com/test.txt'),
  ownerId?: long(name='OwnerId'),
  securityToken?: string(name='SecurityToken'),
  withHeader?: string(name='WithHeader', description='The custom header for prefetch in the JSON format.', example='{
      "Accept-Encoding": [
            "gzip, deflate, br"
      ]
}'),
}

model PreloadVodObjectCachesResponseBody = {
  preloadTaskId?: string(name='PreloadTaskId', description='The ID of the prefetch task. Separate multiple task IDs with commas (,).', example='9524****'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='E5BD4B50-7A02-493A-*****-97B9024B4135'),
}

model PreloadVodObjectCachesResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: PreloadVodObjectCachesResponseBody(name='body'),
}

/**
 * @summary Prefetches resources from an origin server to L2 nodes. Users can directly hit the cache upon their first visits. This way, workloads on the origin server can be reduced.
 *
 * @description > *   This operation is available only in the **China (Shanghai)** region.
 * > *   You can submit a maximum of 500 requests to prefetch resources based on URLs each day by using an Alibaba Cloud account. You cannot prefetch resources based on directories.
 * > *   You can call the [RefreshVodObjectCaches](https://help.aliyun.com/document_detail/69215.html) operation to refresh content and the [PreloadVodObjectCaches](https://help.aliyun.com/document_detail/69211.htmll) operation to prefetch content.
 *
 * @param request PreloadVodObjectCachesRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return PreloadVodObjectCachesResponse
 */
async function preloadVodObjectCachesWithOptions(request: PreloadVodObjectCachesRequest, runtime: $RuntimeOptions): PreloadVodObjectCachesResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.area)) {
    query['Area'] = request.area;
  }
  if (!$isNull(request.l2Preload)) {
    query['L2Preload'] = request.l2Preload;
  }
  if (!$isNull(request.objectPath)) {
    query['ObjectPath'] = request.objectPath;
  }
  if (!$isNull(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!$isNull(request.securityToken)) {
    query['SecurityToken'] = request.securityToken;
  }
  if (!$isNull(request.withHeader)) {
    query['WithHeader'] = request.withHeader;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'PreloadVodObjectCaches',
    version = '2017-03-21',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Prefetches resources from an origin server to L2 nodes. Users can directly hit the cache upon their first visits. This way, workloads on the origin server can be reduced.
 *
 * @description > *   This operation is available only in the **China (Shanghai)** region.
 * > *   You can submit a maximum of 500 requests to prefetch resources based on URLs each day by using an Alibaba Cloud account. You cannot prefetch resources based on directories.
 * > *   You can call the [RefreshVodObjectCaches](https://help.aliyun.com/document_detail/69215.html) operation to refresh content and the [PreloadVodObjectCaches](https://help.aliyun.com/document_detail/69211.htmll) operation to prefetch content.
 *
 * @param request PreloadVodObjectCachesRequest
 * @return PreloadVodObjectCachesResponse
 */
async function preloadVodObjectCaches(request: PreloadVodObjectCachesRequest): PreloadVodObjectCachesResponse {
  var runtime = new $RuntimeOptions{};
  return preloadVodObjectCachesWithOptions(request, runtime);
}

model ProduceEditingProjectVideoRequest {
  appId?: string(name='AppId', description='The ID of the application. Default value: **app-1000000**. For more information, see [Multi-application service](https://help.aliyun.com/document_detail/113600.html).', example='app-****'),
  coverURL?: string(name='CoverURL', description='The thumbnail URL of the online editing project.', example='https://example.aliyundoc.com/6AB4D0E1E1C7446888351****.png'),
  description?: string(name='Description', description='The description of the online editing project.', example='description test'),
  mediaMetadata?: string(name='MediaMetadata', description='The video metadata. The value must be in JSON format. For more information about the parameter structure, see [MediaMetadata](~~52839#title_rtf_ry5_gjp~~).', example='{"Description":"video description","Title":"userData test"}'),
  ownerId?: long(name='OwnerId'),
  produceConfig?: string(name='ProduceConfig', description='The configuration of video production. The value must be in the JSON format. For more information about the parameter structure, see [ProduceConfig](~~52839#title-ybl-7cs-y7d~~).

>  StorageLocation is required if you produce videos in a region other than China (Shanghai).', example='{"TemplateGroupId":"6d11e25ea30a4c465435c74****"}'),
  projectId?: string(name='ProjectId', description='The ID of the online editing project. You can use one of the following methods to obtain the ID of the online editing project:

*   Log on to the [ApsaraVideo VOD console](https://vod.console.aliyun.com). In the left-side navigation pane, choose **Production Center** > **Video Editing** to view the ID of the online editing project.
*   Obtain the value of ProjectId from the response to the [AddEditingProject](https://help.aliyun.com/document_detail/69048.html) operation.', example='fb2101bf24b4cb318787dc****'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
  timeline?: string(name='Timeline', description='The timeline of the online editing project. The value must be in JSON format. For more information about the parameter structure, see [Timeline](~~52839#07bc7fe0f2xuh~~).', example='{"VideoTracks":[{"VideoTrackClips":[{"MediaId":"cc3308ac59615a54328bc3443****"},{"MediaId":"da87a9cff645cd88bc6d8326e4****"}]}]}'),
  title?: string(name='Title', description='The title of the online editing project.', example='editing project test'),
  userData?: string(name='UserData', description='The custom configurations, such as the callback configuration. The value must be a JSON string. For more information about the parameter structure, see [UserData](~~86952#title_vz7_xzs_0c5~~).

> The callback configurations take effect only after you specify an HTTP URL for receiving callback notifications and select the event types in the ApsaraVideo VOD console.', example='{"Extend":{"width":1280,"id":"028a8e56b1ebf6bb7afc74****","height":720},"MessageCallback":{"CallbackURL":"https://example.aliyundoc.com/2016-08-15/proxy/httpcallback/testcallback/","CallbackType":"http"}}'),
}

model ProduceEditingProjectVideoResponseBody = {
  mediaId?: string(name='MediaId', description='The ID of the produced video.

> *   This parameter is returned for each request.
> *   If a value is returned for this parameter, the video production task is being asynchronously processed.', example='006204a11bb386bb25491f95f****'),
  projectId?: string(name='ProjectId', description='The ID of the online editing project.', example='fb2101bf24b4cb318787dc****'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='25818875-5F78-4AF6-D7393642CA58****'),
}

model ProduceEditingProjectVideoResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ProduceEditingProjectVideoResponseBody(name='body'),
}

/**
 * @summary Produces a video from one or more source files. You can directly specify source files by configuring the Timeline parameter. Alternatively, you can specify source files after you create an online editing project.
 *
 * @description *   **Make sure that you understand the billing method and price of ApsaraVideo VOD before you call this operation. You are charged for using the online editing feature. For more information, see [Billing](~~188310#section-pyv-b8h-bo7~~).**
 * *   This operation returns only the submission result of a video production task. When the submission result is returned, video production may still be in progress. After a video production task is submitted, the task is queued in the background for asynchronous processing.
 * *   The source files that are used in the timeline of an online editing project can be materials directly uploaded to the online project or selected from the media asset library. Only media assets that are in the Normal state can be used in the project.
 * *   Videos are produced based on ProjectId and Timeline. The following content describes the parameter configurations:
 *     *   You must specify ProjectId or Timeline. If you leave both parameters empty, the video cannot be produced.
 *     *   If you specify Timeline and leave ProjectId empty, the system automatically creates an online editing project based on Timeline and adds the materials specified in the Timeline to the project to produce videos.
 *     *   If you specify ProjectId and leave Timeline empty, the system automatically uses the latest timeline information of the project to produce videos.
 *     *   If you specify both ProjectId and Timeline, the system automatically uses the timeline information that you specified to produce videos and updates the project timeline and materials. You can also specify other parameters to update the corresponding information about the online editing project.
 * *   You can create up to 100 video tracks, 100 image tracks, and 100 subtitle tracks in a project.
 * *   The total size of material files cannot exceed 1 TB.
 * *   The buckets in which the materials reside and where the exported videos are stored must be in the same region as the region where ApsaraVideo VOD is activated.
 * *   The exported videos must meet the following requirements:
 *     *   The width and height of the video image cannot be less than 128 pixels.
 *     *   The width and height of the video image cannot exceed 4,096 pixels.
 *     *   The width cannot exceed 2,160 pixels.
 * *   After a video is produced, the video is automatically uploaded to ApsaraVideo VOD. Then, the **ProduceMediaComplete** and **FileUploadComplete** event notifications are sent to you. After the produced video is transcoded, the **StreamTranscodeComplete** and **TranscodeComplete** event notifications are sent to you.
 * *   You can add special effects to the video. For more information, see [Special effects](https://help.aliyun.com/document_detail/69082.html).
 *
 * @param request ProduceEditingProjectVideoRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ProduceEditingProjectVideoResponse
 */
async function produceEditingProjectVideoWithOptions(request: ProduceEditingProjectVideoRequest, runtime: $RuntimeOptions): ProduceEditingProjectVideoResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.appId)) {
    query['AppId'] = request.appId;
  }
  if (!$isNull(request.coverURL)) {
    query['CoverURL'] = request.coverURL;
  }
  if (!$isNull(request.description)) {
    query['Description'] = request.description;
  }
  if (!$isNull(request.mediaMetadata)) {
    query['MediaMetadata'] = request.mediaMetadata;
  }
  if (!$isNull(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!$isNull(request.produceConfig)) {
    query['ProduceConfig'] = request.produceConfig;
  }
  if (!$isNull(request.projectId)) {
    query['ProjectId'] = request.projectId;
  }
  if (!$isNull(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!$isNull(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  if (!$isNull(request.timeline)) {
    query['Timeline'] = request.timeline;
  }
  if (!$isNull(request.title)) {
    query['Title'] = request.title;
  }
  if (!$isNull(request.userData)) {
    query['UserData'] = request.userData;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'ProduceEditingProjectVideo',
    version = '2017-03-21',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Produces a video from one or more source files. You can directly specify source files by configuring the Timeline parameter. Alternatively, you can specify source files after you create an online editing project.
 *
 * @description *   **Make sure that you understand the billing method and price of ApsaraVideo VOD before you call this operation. You are charged for using the online editing feature. For more information, see [Billing](~~188310#section-pyv-b8h-bo7~~).**
 * *   This operation returns only the submission result of a video production task. When the submission result is returned, video production may still be in progress. After a video production task is submitted, the task is queued in the background for asynchronous processing.
 * *   The source files that are used in the timeline of an online editing project can be materials directly uploaded to the online project or selected from the media asset library. Only media assets that are in the Normal state can be used in the project.
 * *   Videos are produced based on ProjectId and Timeline. The following content describes the parameter configurations:
 *     *   You must specify ProjectId or Timeline. If you leave both parameters empty, the video cannot be produced.
 *     *   If you specify Timeline and leave ProjectId empty, the system automatically creates an online editing project based on Timeline and adds the materials specified in the Timeline to the project to produce videos.
 *     *   If you specify ProjectId and leave Timeline empty, the system automatically uses the latest timeline information of the project to produce videos.
 *     *   If you specify both ProjectId and Timeline, the system automatically uses the timeline information that you specified to produce videos and updates the project timeline and materials. You can also specify other parameters to update the corresponding information about the online editing project.
 * *   You can create up to 100 video tracks, 100 image tracks, and 100 subtitle tracks in a project.
 * *   The total size of material files cannot exceed 1 TB.
 * *   The buckets in which the materials reside and where the exported videos are stored must be in the same region as the region where ApsaraVideo VOD is activated.
 * *   The exported videos must meet the following requirements:
 *     *   The width and height of the video image cannot be less than 128 pixels.
 *     *   The width and height of the video image cannot exceed 4,096 pixels.
 *     *   The width cannot exceed 2,160 pixels.
 * *   After a video is produced, the video is automatically uploaded to ApsaraVideo VOD. Then, the **ProduceMediaComplete** and **FileUploadComplete** event notifications are sent to you. After the produced video is transcoded, the **StreamTranscodeComplete** and **TranscodeComplete** event notifications are sent to you.
 * *   You can add special effects to the video. For more information, see [Special effects](https://help.aliyun.com/document_detail/69082.html).
 *
 * @param request ProduceEditingProjectVideoRequest
 * @return ProduceEditingProjectVideoResponse
 */
async function produceEditingProjectVideo(request: ProduceEditingProjectVideoRequest): ProduceEditingProjectVideoResponse {
  var runtime = new $RuntimeOptions{};
  return produceEditingProjectVideoWithOptions(request, runtime);
}

model RefreshMediaPlayUrlsRequest {
  definitions?: string(name='Definitions', description='Specifies the resolutions of the media streams you want to refresh or prefetch. You can specify multiple resolutions. Separate multiple resolutions with commas (,). If you leave this parameter empty, media streams in all resolutions are refreshed or prefetched by default.

>  The value must be supported in the **Definition** section in [Parameters for media assets](https://help.aliyun.com/document_detail/124671.html).', example='HD, SD'),
  formats?: string(name='Formats', description='The formats of the media streams you want to refresh or prefetch. You can specify multiple formats. Separate multiple formats with commas (,). If you leave this parameter empty, media streams in all formats are refreshed or prefetched by default. Valid values:

*   **mp4**
*   **m3u8**
*   **mp3**
*   **flv**
*   **webm**
*   **ts**', example='mp4,m3u8'),
  mediaIds?: string(name='MediaIds', description='The IDs of the media files that you want to refresh or prefetch. You can specify a maximum of 20 IDs. Separate multiple IDs with commas (,). You can use one of the following methods to obtain the ID:

*   Log on to the [ApsaraVideo VOD](https://vod.console.aliyun.com) console. In the left-side navigation pane, choose **Media Files** > **Audio/Video**. On the Video and Audio page, view the ID of the audio or video file. This method is applicable to files that are uploaded by using the ApsaraVideo VOD console.
*   Obtain the value of VideoId from the response to the [CreateUploadVideo](https://help.aliyun.com/document_detail/55407.html) operation that you call to upload media files.
*   Obtain the value of VideoId from the response to the [SearchMedia](https://help.aliyun.com/document_detail/86044.html) operation that you call to query the media ID after the media file is uploaded.

This parameter is required.', example='ca3a8f6e4957b658067095869****, a6e49sfgd23p5g9ja7095863****'),
  resultType?: string(name='ResultType', description='Specifies the type of the refresh or prefetch operation. Default value: Single. Valid values:

*   **Single**: Only one latest transcoded stream is refreshed or prefetched for each resolution and format.
*   **Multiple**: All transcoded streams are refreshed or prefetched for each resolution and format.', example='Single'),
  sliceCount?: int32(name='SliceCount', description='Specifies the number of the playback URLs of the TS files for the M3U8 media stream you want to refresh or prefetch. After you set this parameter, only the playback URLs of the first N TS files will be refreshed or prefetched. Valid values: 1 to 20. Default value: 5.', example='5'),
  sliceFlag?: boolean(name='SliceFlag', description='Specifies whether to refresh or prefetch the playback URLs of the TS files of the M3U8 media stream. Default value: false. Valid values:

*   **false**
*   **true**', example='false'),
  streamType?: string(name='StreamType', description='Specifies the types of media streams you want to refresh or prefetch. You can specify multiple types. Separate multiple types with commas (,). If you leave this parameter empty, media streams in all types are refreshed or prefetched by default. Valid values:

*   **video**
*   **audio**', example='video'),
  taskType?: string(name='TaskType', description='The type of the task that you want to create. Valid values:

*   **Refresh**
*   **Preload**

This parameter is required.', example='Preload'),
  userData?: string(name='UserData', description='The custom configurations such as callback configurations and upload acceleration configurations. The value must be a JSON string. For more information, see the "UserData: specifies the custom configurations for media upload" section in the [Request parameter](https://help.aliyun.com/document_detail/86952.html) topic.

>*   The callback configurations take effect only after you specify the HTTP callback URL and select specific callback events in the ApsaraVideo VOD console. For more information about how to configure HTTP callback settings in the ApsaraVideo VOD console, see [Configure callback settings](https://help.aliyun.com/document_detail/86071.html).
>*   To enable the upload acceleration feature, submit a ticket. For more information, see [Overview](https://help.aliyun.com/document_detail/55396.html). For more information about how to submit a ticket, see [Contact us](https://help.aliyun.com/document_detail/464625.html).', example='{"MessageCallback":{"CallbackURL":"http://example.aliyundoc.com"}, "Extend":{"localId":"xxx","test":"www"}}'),
}

model RefreshMediaPlayUrlsResponseBody = {
  forbiddenMediaIds?: string(name='ForbiddenMediaIds', description='The IDs of the media files that cannot be operated on. In most cases, media files cannot be operated on because you are not authorized to perform the operations. For more information, see [Overview](https://help.aliyun.com/document_detail/113600.html).', example='a6e49sfgd23p5g9ja7095863****'),
  mediaRefreshJobId?: string(name='MediaRefreshJobId', description='The ID of the refresh or prefetch task.', example='41d465e31957****'),
  nonExistMediaIds?: string(name='NonExistMediaIds', description='The IDs of the media files that do not exist.', example='ca3a8f6e4957b658067095869****'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='25818875-5F78-4AF6-04D5-D7393642****'),
}

model RefreshMediaPlayUrlsResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: RefreshMediaPlayUrlsResponseBody(name='body'),
}

/**
 * @summary Submits media refresh or prefetch tasks based on the media IDs.
 *
 * @description *   ApsaraVideo VOD allows you to purge and prefetch resources. The purge feature forces the point of presence (POP) to clear cached resources and retrieve the latest resources from origin servers. The prefetch feature allows the POP to retrieve frequently accessed resources from origin servers during off-peak hours. This increases the cache hit ratio.
 * *   You can call this operation to submit purge or prefetch tasks based on the media ID. You can also specify the format and resolution of the media streams to purge or prefetch based on your business requirements.
 * *   You can submit a maximum of 20 purge or prefetch tasks at a time.
 *
 * @param request RefreshMediaPlayUrlsRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return RefreshMediaPlayUrlsResponse
 */
async function refreshMediaPlayUrlsWithOptions(request: RefreshMediaPlayUrlsRequest, runtime: $RuntimeOptions): RefreshMediaPlayUrlsResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.definitions)) {
    query['Definitions'] = request.definitions;
  }
  if (!$isNull(request.formats)) {
    query['Formats'] = request.formats;
  }
  if (!$isNull(request.mediaIds)) {
    query['MediaIds'] = request.mediaIds;
  }
  if (!$isNull(request.resultType)) {
    query['ResultType'] = request.resultType;
  }
  if (!$isNull(request.sliceCount)) {
    query['SliceCount'] = request.sliceCount;
  }
  if (!$isNull(request.sliceFlag)) {
    query['SliceFlag'] = request.sliceFlag;
  }
  if (!$isNull(request.streamType)) {
    query['StreamType'] = request.streamType;
  }
  if (!$isNull(request.taskType)) {
    query['TaskType'] = request.taskType;
  }
  if (!$isNull(request.userData)) {
    query['UserData'] = request.userData;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'RefreshMediaPlayUrls',
    version = '2017-03-21',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Submits media refresh or prefetch tasks based on the media IDs.
 *
 * @description *   ApsaraVideo VOD allows you to purge and prefetch resources. The purge feature forces the point of presence (POP) to clear cached resources and retrieve the latest resources from origin servers. The prefetch feature allows the POP to retrieve frequently accessed resources from origin servers during off-peak hours. This increases the cache hit ratio.
 * *   You can call this operation to submit purge or prefetch tasks based on the media ID. You can also specify the format and resolution of the media streams to purge or prefetch based on your business requirements.
 * *   You can submit a maximum of 20 purge or prefetch tasks at a time.
 *
 * @param request RefreshMediaPlayUrlsRequest
 * @return RefreshMediaPlayUrlsResponse
 */
async function refreshMediaPlayUrls(request: RefreshMediaPlayUrlsRequest): RefreshMediaPlayUrlsResponse {
  var runtime = new $RuntimeOptions{};
  return refreshMediaPlayUrlsWithOptions(request, runtime);
}

model RefreshUploadVideoRequest {
  ownerId?: long(name='OwnerId'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
  videoId?: string(name='VideoId', description='The ID of the audio or video file. You can use one of the following methods to obtain the ID:

*   Log on to the [ApsaraVideo VOD console](https://vod.console.aliyun.com) and choose **Media Files** > **Audio/Video** in the left-side navigation pane to view the ID.
*   View the value of the VideoId parameter returned by the [CreateUploadVideo](https://help.aliyun.com/document_detail/55407.html) operation that you called to upload the audio or video file.
*   After an audio or video file is uploaded, obtain the value of VideoId from the response to the [SearchMedia](https://help.aliyun.com/document_detail/86044.html) operation that you call to query the audio or video ID.

This parameter is required.', example='c6a23a870c8c4ffcd40cbd381333****'),
}

model RefreshUploadVideoResponseBody = {
  requestId?: string(name='RequestId', description='The ID of the request.', example='25818875-5F78-4A43-7DF6-D7393642****'),
  uploadAddress?: string(name='UploadAddress', description='The upload URL.

>  The returned upload URL is a Base64-encoded URL. You must decode the Base64-encoded upload URL before you use an SDK or call an API operation to upload media files. You need to parse UploadAddress only if you use the OSS SDK or call an OSS API operation to upload media files.', example='eyJTZWN1cml0eVRiQ0FJU3p3TjFxNkZ0NUIyeW****'),
  uploadAuth?: string(name='UploadAuth', description='The upload credential.

>  The returned upload credential is a Base64-encoded value. You must decode the Base64-encoded upload URL before you use an SDK or call an API operation to upload media files. You need to parse UploadAuth only if you use the OSS SDK or call an OSS API operation to upload media files.', example='FJU3p3TZ0NUIyeW****'),
  videoId?: string(name='VideoId', description='The ID of the audio or video file.', example='c6a23a870c8c4ffcd40cbd381333****'),
}

model RefreshUploadVideoResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: RefreshUploadVideoResponseBody(name='body'),
}

/**
 * @summary Obtains a new upload credential after a file failed to be uploaded.
 *
 * @description You can also call this operation to overwrite the source file of an audio or video file. After you call this operation, the system obtains the upload URL and uploads a new source file without changing the ID of the audio or video file. If you have configured transcoding or snapshot capture for the upload, the transcoding or snapshot capture job is automatically triggered. For more information, see [Upload URLs and credentials](https://help.aliyun.com/document_detail/55397.html).
 *
 * @param request RefreshUploadVideoRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return RefreshUploadVideoResponse
 */
async function refreshUploadVideoWithOptions(request: RefreshUploadVideoRequest, runtime: $RuntimeOptions): RefreshUploadVideoResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!$isNull(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!$isNull(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  if (!$isNull(request.videoId)) {
    query['VideoId'] = request.videoId;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'RefreshUploadVideo',
    version = '2017-03-21',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Obtains a new upload credential after a file failed to be uploaded.
 *
 * @description You can also call this operation to overwrite the source file of an audio or video file. After you call this operation, the system obtains the upload URL and uploads a new source file without changing the ID of the audio or video file. If you have configured transcoding or snapshot capture for the upload, the transcoding or snapshot capture job is automatically triggered. For more information, see [Upload URLs and credentials](https://help.aliyun.com/document_detail/55397.html).
 *
 * @param request RefreshUploadVideoRequest
 * @return RefreshUploadVideoResponse
 */
async function refreshUploadVideo(request: RefreshUploadVideoRequest): RefreshUploadVideoResponse {
  var runtime = new $RuntimeOptions{};
  return refreshUploadVideoWithOptions(request, runtime);
}

model RefreshVodObjectCachesRequest {
  force?: boolean(name='Force', description='Specifies whether to purge resources in a directory if the resources requested are different from the resources on the origin server.

*   **true**: refreshes all resources in the directory. If you set this parameter to true, when the requested content matches the resource in the directory, the POP retrieves the resource from the origin server, returns the resource to the client, and caches the resource.
*   **false** (default): refreshes the changed resources in the directory. If you set this parameter to false, when the requested content matches the resource in the directory, the POP obtains the Last-Modified parameter of the resource from the origin server. If the value of the obtained Last-Modified parameter is the same as that of the cached resource, the cached resource is returned. Otherwise, the POP retrieves the resource from the origin server, returns the resource to the client, and caches the resource.', example='false'),
  objectPath?: string(name='ObjectPath', description='The URL of the file to be prefetched. Separate multiple URLs with line breaks (\\\\n or \\\\r\\\\n).

This parameter is required.', example='abc.com/image/1.png'),
  objectType?: string(name='ObjectType', description='The type of the object that you want to refresh. Valid values:

*   **File** (default): refreshes one or more files.
*   **Directory**: refreshes the files in specified directories.
*   **Regex**: refreshes content based on regular expressions.
*   **IgnoreParams**: removes the question mark (?) and parameters after the question mark (?) in a request URL and refreshes content. After you call this operation with the request URL submitted, the system compares the submitted URL with the URL of the cached resource without specific parameters. If the URLs match, the POPs refresh the cached resource.', example='File'),
  ownerId?: long(name='OwnerId'),
  securityToken?: string(name='SecurityToken'),
}

model RefreshVodObjectCachesResponseBody = {
  refreshTaskId?: string(name='RefreshTaskId', description='The ID of the refresh task. Multiple IDs are separated by commas (,). Refresh tasks are merged based on the following rules:

If the tasks are set for the same accelerated domain name, submitted within the same second, and refresh content based on URLs instead of directories, the tasks IDs are merged into the same task ID (RefreshTaskId). If the number of these tasks exceeds 2,000, every 2,000 tasks IDs are merged into the same task ID (RefreshTaskId).', example='70422*****2904'),
  requestId?: string(name='RequestId', description='The request ID.', example='D61E4801-EAFF-4A63-****-FBF6CE1CFD1C'),
}

model RefreshVodObjectCachesResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: RefreshVodObjectCachesResponseBody(name='body'),
}

/**
 * @summary Refreshes files on Alibaba Cloud CDN nodes. You can refresh multiple files at a time based on URLs.
 *
 * @description *   This operation is available only in the **China (Shanghai)** region.
 * *   You can submit a maximum of 2,000 requests to refresh resources based on URLs and 100 requests to refresh resources based on directories each day by using an Alibaba Cloud account.
 * *   You can call the [RefreshVodObjectCaches](https://help.aliyun.com/document_detail/69215.html) operation to refresh content and the [PreloadVodObjectCaches](https://help.aliyun.com/document_detail/69211.html) operation to prefetch content.
 *
 * @param request RefreshVodObjectCachesRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return RefreshVodObjectCachesResponse
 */
async function refreshVodObjectCachesWithOptions(request: RefreshVodObjectCachesRequest, runtime: $RuntimeOptions): RefreshVodObjectCachesResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.force)) {
    query['Force'] = request.force;
  }
  if (!$isNull(request.objectPath)) {
    query['ObjectPath'] = request.objectPath;
  }
  if (!$isNull(request.objectType)) {
    query['ObjectType'] = request.objectType;
  }
  if (!$isNull(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!$isNull(request.securityToken)) {
    query['SecurityToken'] = request.securityToken;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'RefreshVodObjectCaches',
    version = '2017-03-21',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Refreshes files on Alibaba Cloud CDN nodes. You can refresh multiple files at a time based on URLs.
 *
 * @description *   This operation is available only in the **China (Shanghai)** region.
 * *   You can submit a maximum of 2,000 requests to refresh resources based on URLs and 100 requests to refresh resources based on directories each day by using an Alibaba Cloud account.
 * *   You can call the [RefreshVodObjectCaches](https://help.aliyun.com/document_detail/69215.html) operation to refresh content and the [PreloadVodObjectCaches](https://help.aliyun.com/document_detail/69211.html) operation to prefetch content.
 *
 * @param request RefreshVodObjectCachesRequest
 * @return RefreshVodObjectCachesResponse
 */
async function refreshVodObjectCaches(request: RefreshVodObjectCachesRequest): RefreshVodObjectCachesResponse {
  var runtime = new $RuntimeOptions{};
  return refreshVodObjectCachesWithOptions(request, runtime);
}

model RegisterMediaRequest {
  registerMetadatas?: string(name='RegisterMetadatas', description='The metadata of the media files. The value must be a JSON string. You can specify the metadata for up to 10 media files at a time. For more information about the metadata of media files, see the **RegisterMetadata** section of this topic.

This parameter is required.', example='[{"FileURL":"https://****.oss-cn-shanghai.aliyuncs.com/video/test/video123.m3u8","Title":"VideoName"}]'),
  templateGroupId?: string(name='TemplateGroupId', description='The ID of the transcoding template group. You can use one of the following methods to obtain the ID:

*   Log on to the [ApsaraVideo VOD console](https://vod.console.aliyun.com). In the left-side navigation pane, choose **Configuration Management** > **Media Processing** > **Transcoding Template Groups**. On the Transcoding Template Groups page, you can view the ID of the transcoding template group.
*   Obtain the value of the TranscodeTemplateGroupId parameter from the response to the [AddTranscodeTemplateGroup](https://help.aliyun.com/document_detail/102665.html) operation that you called to create a transcoding template group.
*   Obtain the value of the TranscodeTemplateGroupId parameter from the response to the [ListTranscodeTemplateGroup](https://help.aliyun.com/document_detail/102669.html) operation that you called to query transcoding template groups.

> 

*   If you do not need to transcode media files, set the TemplateGroupId parameter to VOD_NO_TRANSCODE. If you do not specify this configuration, errors occur on your files. If you need to transcode media files, specify the ID of the transcoding template group.

*   If you specify both WorkflowId and TemplateGroupId, the value of the WorkflowId parameter takes effect. For more information, see [Workflows](https://help.aliyun.com/document_detail/115347.html).', example='ca3a8f6e49c87b65806709586****'),
  userData?: string(name='UserData', description='The custom settings. The value must be a JSON string. You can configure settings such as message callbacks. For more information, see [UserData](~~86952#section_6fg_qll_v3w~~).

>  You cannot configure callbacks for this operation. No callback message is returned after the media files are registered even if you configure callback settings for this parameter. If you configure callback settings for the UserData parameter when you create media processing jobs such as transcoding and snapshot capture jobs for the media file, the callback URL that you specified is used. If you do not configure callback settings when you create media processing jobs, the callback URL that you specified for the UserData parameter when you register the media file is used.', example='{"Extend":{"localId":"****","test":"www"}}'),
  workflowId?: string(name='WorkflowId', description='The ID of the workflow. To view the workflow ID, perform the following steps: Log on to the [ApsaraVideo VOD console](https://vod.console.aliyun.com). In the left-side navigation pane, choose **Configuration Management** > **Media Processing** > **Workflows**.

>  If you specify both WorkflowId and TemplateGroupId, the value of WorkflowId parameter takes effect. For more information, see [Workflows](https://help.aliyun.com/document_detail/115347.html).', example='637adc2b7ba51a83d841606f8****'),
}

model RegisterMediaResponseBody = {
  failedFileURLs?: [ string ](name='FailedFileURLs', description='The URLs of the media files that failed to be registered.'),
  registeredMediaList?: [ 
    {
      fileURL?: string(name='FileURL', description='The URL of the media file.', example='http://****.oss-cn-shanghai.aliyuncs.com/vod_sample_01.mp4'),
      mediaId?: string(name='MediaId', description='The ID of the media file that is registered with ApsaraVideo VOD. If the registered media file is an audio or video file, the value of this parameter is the same as that of the VideoId parameter.', example='d97af32828084d1896683b1aa38****'),
      newRegister?: boolean(name='NewRegister', description='Indicates whether the media file is newly registered or repeatedly registered. Valid values:

*   **true**: The media file is newly registered.
*   **false**: The media file is repeatedly registered.', example='false'),
    }
  ](name='RegisteredMediaList', description='The media files that are registered, including newly registered and repeatedly registered media files.'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='14F43C5C-8033-448B-AD04F64E5098****'),
}

model RegisterMediaResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: RegisterMediaResponseBody(name='body'),
}

/**
 * @summary Registers media files. After you add an Object Storage Service (OSS) bucket to ApsaraVideo VOD, you must register the media files in the bucket to generate the required information before you use features such as transcoding and snapshot capture on the media files.
 *
 * @description *   After you add an OSS bucket to ApsaraVideo VOD, you must register media files in the OSS bucket to generate the required information. Then, you can use media IDs for features such as transcoding, snapshot capture, and AI processing.use features such as xxx on media files by specifying their IDs?
 * *   You can register up to 10 media files in an OSS bucket in a request. The media files must be stored in the same bucket.
 * *   If you do not specify a transcoding template group ID when you upload a media file to ApsaraVideo VOD, the media file is automatically transcoded based on the default template group. If you do not specify a transcoding template group ID after you register a media file, the media file is not automatically transcoded. The registered media files are automatically transcoded only if you specify a transcoding template group ID.
 * *   If the media file that you want to register has been registered, this operation returns only the unique media ID that is associated with the media file. No further operation is performed.
 * *   Make sure that the media file that you want to register has a valid suffix. Otherwise, the registration fails.
 *
 * @param request RegisterMediaRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return RegisterMediaResponse
 */
async function registerMediaWithOptions(request: RegisterMediaRequest, runtime: $RuntimeOptions): RegisterMediaResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.registerMetadatas)) {
    query['RegisterMetadatas'] = request.registerMetadatas;
  }
  if (!$isNull(request.templateGroupId)) {
    query['TemplateGroupId'] = request.templateGroupId;
  }
  if (!$isNull(request.userData)) {
    query['UserData'] = request.userData;
  }
  if (!$isNull(request.workflowId)) {
    query['WorkflowId'] = request.workflowId;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'RegisterMedia',
    version = '2017-03-21',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Registers media files. After you add an Object Storage Service (OSS) bucket to ApsaraVideo VOD, you must register the media files in the bucket to generate the required information before you use features such as transcoding and snapshot capture on the media files.
 *
 * @description *   After you add an OSS bucket to ApsaraVideo VOD, you must register media files in the OSS bucket to generate the required information. Then, you can use media IDs for features such as transcoding, snapshot capture, and AI processing.use features such as xxx on media files by specifying their IDs?
 * *   You can register up to 10 media files in an OSS bucket in a request. The media files must be stored in the same bucket.
 * *   If you do not specify a transcoding template group ID when you upload a media file to ApsaraVideo VOD, the media file is automatically transcoded based on the default template group. If you do not specify a transcoding template group ID after you register a media file, the media file is not automatically transcoded. The registered media files are automatically transcoded only if you specify a transcoding template group ID.
 * *   If the media file that you want to register has been registered, this operation returns only the unique media ID that is associated with the media file. No further operation is performed.
 * *   Make sure that the media file that you want to register has a valid suffix. Otherwise, the registration fails.
 *
 * @param request RegisterMediaRequest
 * @return RegisterMediaResponse
 */
async function registerMedia(request: RegisterMediaRequest): RegisterMediaResponse {
  var runtime = new $RuntimeOptions{};
  return registerMediaWithOptions(request, runtime);
}

model RestoreMediaRequest {
  mediaIds?: string(name='MediaIds', description='The ID of the media asset (VideoId). Separate multiple IDs with commas (,). You can specify a maximum of 20 IDs. You can use one of the following methods to obtain the ID of the media asset:

*   Log on to the ApsaraVideo VOD console. In the left-side navigation pane, choose Media Files > Audio/Video. On the Video and Audio page, view the ID of the media asset. This method is applicable to files that are uploaded by using the ApsaraVideo VOD console.
*   Obtain the value of VideoId from the response to the CreateUploadVideo operation that you call to upload media assets.
*   Obtain the value of VideoId from the response to the SearchMedia operation that you call to query the media ID after the media asset is uploaded.

This parameter is required.', example='8bc8e94fe4e55abde85718****,eb186180e989dd56****'),
  restoreDays?: string(name='RestoreDays', description='The number of days during which media assets remain in the restored state. Default value: 1. The maximum validity period of a restored Archive media asset is 7 days and the maximum validity period of a restored Cold Archive media asset is 365 days.', example='2'),
  restoreTier?: string(name='RestoreTier', description='The restoration priority. This parameter is required only when you restore a Cold Archive media file. Valid values:

*   **Expedited**: The file is restored within 1 hour.
*   **Standard**: The file is restored within 2 to 5 hours.
*   **Bulk**: The file is restored within 5 to 12 hours.', example='Standard'),
  scope?: string(name='Scope', description='The modification range. Valid values:

*   **All**: restores all resources, including the source files and transcoded streams.
*   **SourceFile**: restores only the source files.', example='All'),
}

model RestoreMediaResponseBody = {
  forbiddenList?: {
    mediaForbiddenReasonDTO?: [ 
    {
      mediaId?: string(name='MediaId', description='The ID of the media asset.', example='fa10ee70898671edb99f6eb3690d****'),
      reason?: string(name='Reason', description='The reason for the failure.', example='Forbidden.RestoreMedia'),
    }
  ](name='MediaForbiddenReasonDTO')
  }(name='ForbiddenList', description='The IDs of the media asset that failed to be processed.'),
  ignoredList?: {
    mediaId?: [ string ](name='MediaId')
  }(name='IgnoredList', description='The IDs of the media assets that failed to be obtained.'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='8E70E3F8-E2EE-47BC-4677-379D6F28****'),
  success?: boolean(name='Success', description='Indicates whether the request was successful.', example='true'),
}

model RestoreMediaResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: RestoreMediaResponseBody(name='body'),
}

/**
 * @summary Restores media assets.
 *
 * @description You can call this operation to restore only Archive and Cold Archive audio and video files. You can access the audio and video files after the files are restored. You cannot change the storage class of an audio or video file that is being restored. You are charged for the retrieval traffic generated during restoration. After a Cold Archive audio or video file is restored, a Standard replica of the file is generated for access. You are charged for the storage of the replica before the file returns to the frozen state.
 *
 * @param request RestoreMediaRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return RestoreMediaResponse
 */
async function restoreMediaWithOptions(request: RestoreMediaRequest, runtime: $RuntimeOptions): RestoreMediaResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.mediaIds)) {
    query['MediaIds'] = request.mediaIds;
  }
  if (!$isNull(request.restoreDays)) {
    query['RestoreDays'] = request.restoreDays;
  }
  if (!$isNull(request.restoreTier)) {
    query['RestoreTier'] = request.restoreTier;
  }
  if (!$isNull(request.scope)) {
    query['Scope'] = request.scope;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'RestoreMedia',
    version = '2017-03-21',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Restores media assets.
 *
 * @description You can call this operation to restore only Archive and Cold Archive audio and video files. You can access the audio and video files after the files are restored. You cannot change the storage class of an audio or video file that is being restored. You are charged for the retrieval traffic generated during restoration. After a Cold Archive audio or video file is restored, a Standard replica of the file is generated for access. You are charged for the storage of the replica before the file returns to the frozen state.
 *
 * @param request RestoreMediaRequest
 * @return RestoreMediaResponse
 */
async function restoreMedia(request: RestoreMediaRequest): RestoreMediaResponse {
  var runtime = new $RuntimeOptions{};
  return restoreMediaWithOptions(request, runtime);
}

model SearchEditingProjectRequest {
  endTime?: string(name='EndTime', description='The end of the time range to query. The query is performed based on the time range during which the required online editing projects were created. Specify the time in the ISO 8601 standard in the *yyyy-MM-dd*T*HH:mm:ss*Z format. The time must be in UTC.', example='2017-01-11T13:00:00Z'),
  ownerAccount?: string(name='OwnerAccount'),
  ownerId?: string(name='OwnerId'),
  pageNo?: int32(name='PageNo', description='The number of the page to return. Default value: **1**.', example='1'),
  pageSize?: int32(name='PageSize', description='The number of entries to return on each page. Default value: **10**. Maximum value: **100**.', example='10'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: string(name='ResourceOwnerId'),
  sortBy?: string(name='SortBy', description='The sorting rule of results. Valid values:
*   **CreationTime:Desc**: sorts the results based on the creation time in descending order. This is the default value.
*   **CreationTime:Asc**: sorts the results based on the creation time in ascending order.', example='CreationTime:Desc'),
  startTime?: string(name='StartTime', description='The beginning of the time range to query. The query is performed based on the time range during which the required online editing projects were created. Specify the time in the ISO 8601 standard in the *yyyy-MM-dd*T*HH:mm:ss*Z format. The time must be in UTC.', example='2017-01-11T12:00:00Z'),
  status?: string(name='Status', description='The status of the online editing project. Separate multiple states with commas (,). By default, all online editing projects are queried. Valid values:
*   **Normal**: indicates that the online editing project is in draft.
*   **Producing**: indicates that the video is being produced.
*   **Produced**: indicates that the video was produced.
*   **ProduceFailed**: indicates that the video failed to be produced.', example='Normal'),
  title?: string(name='Title', description='The title of the online editing project.', example='test'),
}

model SearchEditingProjectResponseBody = {
  projectList?: {
    project?: [ 
    {
      coverURL?: string(name='CoverURL', description='The thumbnail URL of the online editing project.', example='cover_url'),
      creationTime?: string(name='CreationTime', description='The time when the online editing project was created. The time follows the ISO 8601 standard in the *yyyy-MM-dd*T*HH:mm:ss*Z format. The time is displayed in UTC.', example='2017-01-11T12:00:00Z'),
      description?: string(name='Description', description='The description of the online editing project.', example='test project 001'),
      duration?: float(name='Duration', description='The duration of the online editing project, which must be consistent with the duration of the timeline.
> The Timeline parameter is not included in response parameters.', example='22.65'),
      modifiedTime?: string(name='ModifiedTime', description='The last time when the online editing project was modified. The time follows the ISO 8601 standard in the *yyyy-MM-dd*T*HH:mm:ss*Z format. The time is displayed in UTC.', example='2017-01-11T13:00:00Z'),
      projectId?: string(name='ProjectId', description='The ID of the online editing project.', example='25cfc178d2de4*****e77aebed6afcd'),
      regionId?: string(name='RegionId', description='The region where the online editing project was created.', example='cn-shanghai'),
      status?: string(name='Status', description='The status of the online editing project. Separate multiple states with commas (,). By default, all online editing projects were queried. Valid values:
*   **Normal**: indicates that the online editing project is in draft.
*   **Producing**: indicates that the video is being produced.
*   **Produced**: indicates that the video was produced.
*   **ProduceFailed**: indicates that the video failed to be produced.', example='Normal'),
      storageLocation?: string(name='StorageLocation', description='The path of the Object Storage Service (OSS) bucket where the produced video is stored.
> To view the path of the OSS bucket, log on to the [ApsaraVideo VOD console](https://vod.console.aliyun.com/?spm=a2c4g.11186623.2.15.6948257eaZ4m54#/vod/settings/censored), and choose **Configuration Management** > **Media Management** > **Storage**. On the Storage page, you can view the path of the OSS bucket.', example='location_s'),
      title?: string(name='Title', description='The title of the online editing project.', example='video_150873681****'),
    }
  ](name='Project')
  }(name='ProjectList', description='The list of online editing projects.'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='9262E3DA-07FA-48*****62-FCBB6BC61D08'),
  total?: int32(name='Total', description='The total number of online editing projects returned.', example='2'),
}

model SearchEditingProjectResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: SearchEditingProjectResponseBody(name='body'),
}

/**
 * @summary Queries online editing projects.
 *
 * @param request SearchEditingProjectRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return SearchEditingProjectResponse
 */
async function searchEditingProjectWithOptions(request: SearchEditingProjectRequest, runtime: $RuntimeOptions): SearchEditingProjectResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.endTime)) {
    query['EndTime'] = request.endTime;
  }
  if (!$isNull(request.ownerAccount)) {
    query['OwnerAccount'] = request.ownerAccount;
  }
  if (!$isNull(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!$isNull(request.pageNo)) {
    query['PageNo'] = request.pageNo;
  }
  if (!$isNull(request.pageSize)) {
    query['PageSize'] = request.pageSize;
  }
  if (!$isNull(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!$isNull(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  if (!$isNull(request.sortBy)) {
    query['SortBy'] = request.sortBy;
  }
  if (!$isNull(request.startTime)) {
    query['StartTime'] = request.startTime;
  }
  if (!$isNull(request.status)) {
    query['Status'] = request.status;
  }
  if (!$isNull(request.title)) {
    query['Title'] = request.title;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'SearchEditingProject',
    version = '2017-03-21',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Queries online editing projects.
 *
 * @param request SearchEditingProjectRequest
 * @return SearchEditingProjectResponse
 */
async function searchEditingProject(request: SearchEditingProjectRequest): SearchEditingProjectResponse {
  var runtime = new $RuntimeOptions{};
  return searchEditingProjectWithOptions(request, runtime);
}

model SearchMediaRequest {
  fields?: string(name='Fields', description='The media asset fields to return in the query results.

By default, only the basic media asset fields are returned. You can specify additional media asset fields that need to be returned in the request. For more information, see the "API examples" section of the [Search for media asset information](https://help.aliyun.com/document_detail/99179.html) topic.', example='Title,CoverURL'),
  match?: string(name='Match', description='The filter condition. For more information about the syntax, see [Protocol for media asset search](https://help.aliyun.com/document_detail/86991.html).', example='field = value'),
  pageNo?: int32(name='PageNo', description='The number of the page to return. Default value: **1**.

> If the value of this parameter exceeds **200**, we recommend that you set the ScrollToken parameter as well.', example='1'),
  pageSize?: int32(name='PageSize', description='The number of entries to return on each page. Default value: **10**. Maximum value: **100**.', example='10'),
  scrollToken?: string(name='ScrollToken', description='The pagination identifier. The password must be 32 characters in length The first time you call this operation for each new search, you do not need to specify this parameter. The value of this parameter is returned each time data records that meet the specified filter condition are found. The value is used to record the current position of queried data. Record the returned parameter value and set this parameter according to the following requirements during the next search:

*   If SearchType is set to **video** or **audio** and you need to traverse all data that meets the filter criteria, you must set the ScrollToken parameter.
*   If the value of the PageNo parameter exceeds **200**, we recommend that you set this parameter to optimize search performance.', example='24e0fba7188fae707e146esa54****'),
  searchType?: string(name='SearchType', description='The type of the media asset that you want to query. Default value: video. Valid values:

*   **video**
*   **audio**
*   **image**
*   **attached**

> If this parameter is set to **video** or **audio** and you want to traverse all data that meets the filter criteria, you must set the ScrollToken parameter.', example='video'),
  sortBy?: string(name='SortBy', description='The sort field and order. Separate multiple values with commas (,). Default value: CreationTime:Desc. Valid values:

*   **CreationTime:Desc**: The results are sorted in reverse chronological order based on the creation time.
*   **CreationTime:Asc**: The results are sorted in chronological order based on the creation time.

> * For more information about the sort field, see "Sort field" in the [Search for media asset information](https://help.aliyun.com/document_detail/99179.html) topic.
> * To obtain the first 5,000 data records that meet the specified filter criteria, you can specify a maximum of three sort fields.
> * To obtain all the data records that meet the specified filter criteria, you can specify only one sort field.', example='CreationTime:Desc'),
}

model SearchMediaResponseBody = {
  mediaList?: [ 
    {
      aiData?: {
        aiLabelInfo?: [ 
          {
            category?: string(name='Category', description='The category.', example='Transportation'),
            labelId?: string(name='LabelId', description='The ID of the tag.', example='10310250338'),
            labelName?: string(name='LabelName', description='The name of the tag.', example='Vehicles'),
            occurrences?: [ 
              {
                from?: double(name='From', description='The start time of the clip.', example='1.4'),
                score?: double(name='Score', description='The score.', example='0.75287705'),
                to?: double(name='To', description='The end time of the clip.', example='2.5'),
              }
            ](name='Occurrences', description='The clips.'),
          }
        ](name='AiLabelInfo', description='The AI tags.'),
        ocrInfo?: [ 
          {
            content?: string(name='Content', description='The text content.', example='I\\\\"m Jane.'),
            from?: double(name='From', description='The start time of the subtitle.', example='1.4'),
            to?: double(name='To', description='The end time of the subtitle.', example='2.5'),
          }
        ](name='OcrInfo', description='The information about subtitles.'),
      }(name='AiData', description='Details about AI data.'),
      aiRoughData?: {
        aiCategory?: string(name='AiCategory', description='The AI category.', example='TV series'),
        aiJobId?: string(name='AiJobId', description='The ID of the AI task.', example='cd35b0b0025f71edbfcb472190a9xxxx'),
        saveType?: string(name='SaveType', description='The save type.', example='TEXT'),
        status?: string(name='Status', description='The data status.', example='SaveSuccess'),
      }(name='AiRoughData', description='The basic information about AI data.'),
      attachedMedia?: {
        appId?: string(name='AppId', description='The ID of the application.', example='app-****'),
        businessType?: string(name='BusinessType', description='The type of the auxiliary media asset. Valid values:

*   **watermark**
*   **subtitle**
*   **material**', example='watermark'),
        categories?: [ 
          {
            cateId?: long(name='CateId', description='The category ID of the auxiliary media asset.', example='10027394'),
            cateName?: string(name='CateName', description='The name of the category.', example='test1'),
            level?: long(name='Level', description='The level of the category.', example='1'),
            parentId?: long(name='ParentId', description='The ID of the parent node.', example='-1'),
          }
        ](name='Categories', description='The list of category IDs.'),
        creationTime?: string(name='CreationTime', description='The time when the auxiliary media asset was created. The time follows the ISO 8601 standard in the *yyyy-MM-dd*T*hh:mm:ss*Z format. The time is displayed in UTC.', example='2018-07-19T03:45:25Z'),
        description?: string(name='Description', description='The description of the auxiliary media asset.', example='test3'),
        mediaId?: string(name='MediaId', description='The ID of the auxiliary media asset.', example='a82a2cd7d4e147ba0ed6c1ee372****'),
        modificationTime?: string(name='ModificationTime', description='The time when the auxiliary media asset was updated. The time follows the ISO 8601 standard in the *yyyy-MM-dd*T*hh:mm:ss*Z format. The time is displayed in UTC.', example='2018-07-19T03:48:25Z'),
        status?: string(name='Status', description='The status of the auxiliary media asset. Valid values:

*   **Uploading**
*   **Normal**
*   **UploadFail**', example='Normal'),
        storageLocation?: string(name='StorageLocation', description='The region in which the auxiliary media asset is stored.', example='outin-bfefbb90a47c11*****7426.oss-cn-shanghai.aliyuncs.com'),
        tags?: string(name='Tags', description='The tags of the auxiliary media asset.', example='test2'),
        title?: string(name='Title', description='The title of the auxiliary media asset.', example='test'),
        URL?: string(name='URL', description='The URL of the auxiliary media asset.', example='https://example.com/****.png'),
      }(name='AttachedMedia', description='[The information about the auxiliary media asset](https://help.aliyun.com/document_detail/86991.html).'),
      audio?: {
        appId?: string(name='AppId', description='The ID of the application.', example='app-****'),
        audioId?: string(name='AudioId', description='The ID of the audio file.', example='a82a2cd7d4e147bbed6c1ee372****'),
        cateId?: long(name='CateId', description='The ID of the category.', example='10000123'),
        cateName?: string(name='CateName', description='The name of the category.', example='ceshi'),
        coverURL?: string(name='CoverURL', description='The URL of the thumbnail.', example='http://example.com/image04.jpg'),
        creationTime?: string(name='CreationTime', description='The time when the audio stream was created. The time follows the ISO 8601 standard in the *yyyy-MM-dd*T*hh:mm:ss*Z format. The time is displayed in UTC.', example='2018-07-19T03:45:25Z'),
        description?: string(name='Description', description='The description of the audio file.', example='audio description'),
        downloadSwitch?: string(name='DownloadSwitch', description='The download switch. The audio file can be downloaded offline only when the download switch is turned on. Valid values:

*   **on**
*   **off**', example='on'),
        duration?: float(name='Duration', description='The duration of the audio file.', example='123'),
        mediaSource?: string(name='MediaSource', description='The source of the audio file. Valid values:

*   **general**: The audio file is uploaded by using ApsaraVideo VOD.
*   **short_video**: The audio file is uploaded to ApsaraVideo VOD by using the short video SDK. For more information, see [Introduction](https://help.aliyun.com/document_detail/53407.html).
*   **editing**: The audio file is uploaded to ApsaraVideo VOD after online editing and production. For more information, see [ProduceEditingProjectVideo](https://help.aliyun.com/document_detail/68536.html).
*   **live**: The audio file is recorded and uploaded as a file to ApsaraVideo VOD.', example='general'),
        modificationTime?: string(name='ModificationTime', description='The time when the audio file was updated. The time follows the ISO 8601 standard in the *yyyy-MM-dd*T*hh:mm:ss*Z format. The time is displayed in UTC.', example='2018-07-19T03:48:25Z'),
        preprocessStatus?: string(name='PreprocessStatus', description='The preprocessing status. Only preprocessed videos can be used for live streaming in the production studio. Valid values:

*   **UnPreprocess**
*   **Preprocessing**
*   **PreprocessSucceed**
*   **PreprocessFailed**', example='UnPreprocess'),
        restoreExpiration?: string(name='RestoreExpiration', description='The period of time in which the audio file remains in the restored state.', example='2023-03-30T10:14:14Z'),
        restoreStatus?: string(name='RestoreStatus', description='The restoration status of the audio file. Valid values:

*   **Processing**
*   **Success**
*   **Failed**', example='Success'),
        size?: long(name='Size', description='The size of the audio file.', example='123'),
        snapshots?: [ string ](name='Snapshots', description='The automatic snapshots.'),
        spriteSnapshots?: [ string ](name='SpriteSnapshots', description='The sprite snapshots.'),
        status?: string(name='Status', description='The status of the audio file. Valid values:

*   **Uploading**
*   **Normal**
*   **UploadFail**
*   **Deleted**', example='Normal'),
        storageClass?: string(name='StorageClass', description='The storage class of the audio file. Valid values:

*   **Standard**: All media resources are stored as Standard objects.
*   **IA**: All media resources are stored as IA objects.
*   **Archive**: All media resources are stored as Archive objects.
*   **ColdArchive**: All media resources are stored as Cold Archive objects.
*   **SourceIA**: Only the source file is stored as an IA object.
*   **SourceArchive**: Only the source file is stored as an Archive object.
*   **SourceColdArchive**: Only the source file is stored as a Cold Archive object.
*   **Changing**: The storage class is being modified.', example='Standard'),
        storageLocation?: string(name='StorageLocation', description='The region in which the audio is stored.', example='outin-aaa*****aa.oss-cn-shanghai.aliyuncs.com'),
        tags?: string(name='Tags', description='The tags of the audio file.', example='tag1,tag2'),
        title?: string(name='Title', description='The title of the audio file', example='audio'),
        transcodeMode?: string(name='TranscodeMode', description='The transcoding mode. Valid values:

*   **FastTranscode**: The audio file is immediately transcoded after it is uploaded. You cannot play the file before it is transcoded.
*   **NoTranscode**: The audio file can be played without being transcoded. You can immediately play the file after it is uploaded.
*   **AsyncTranscode**: The audio file can be immediately played and asynchronously transcoded after it is uploaded.', example='FastTranscode'),
      }(name='Audio', description='[The information about the audio](https://help.aliyun.com/document_detail/86991.html).'),
      creationTime?: string(name='CreationTime', description='The time when the media asset was created. The time follows the ISO 8601 standard in the *yyyy-MM-dd*T*hh:mm:ss*Z format. The time is displayed in UTC.', example='2018-07-19T03:45:25Z'),
      image?: {
        appId?: string(name='AppId', description='The ID of the application.', example='app-****'),
        cateId?: long(name='CateId', description='The ID of the category.', example='1000123'),
        cateName?: string(name='CateName', description='The name of the category.', example='beauty'),
        creationTime?: string(name='CreationTime', description='The time when the image was created. The time follows the ISO 8601 standard in the *yyyy-MM-dd*T*hh:mm:ss*Z format. The time is displayed in UTC.', example='2018-07-19T03:45:25Z'),
        description?: string(name='Description', description='The description of the image file.', example='image test'),
        imageId?: string(name='ImageId', description='The ID of the image file.', example='11130843741se99wqmoes****'),
        modificationTime?: string(name='ModificationTime', description='The time when the image file was updated. The time follows the ISO 8601 standard in the *yyyy-MM-dd*T*hh:mm:ss*Z format. The time is displayed in UTC.', example='2018-07-19T03:48:25Z'),
        status?: string(name='Status', description='The status of the image file.

*   **Uploading**
*   **Normal**
*   **UploadFail**', example='Uploading'),
        storageLocation?: string(name='StorageLocation', description='The region in which the image is stored.', example='outin-bfefbb90a47c******163e1c7426.oss-cn-shanghai.aliyuncs.com'),
        tags?: string(name='Tags', description='The tags of the image file.', example='tag1'),
        title?: string(name='Title', description='The title of the image file.', example='image1'),
        URL?: string(name='URL', description='The URL of the image file.', example='https://example.com/****.png'),
      }(name='Image', description='[The information about the image](https://help.aliyun.com/document_detail/86991.html).'),
      mediaId?: string(name='MediaId', description='The ID of the file.', example='a82a2cd7d4e147bbed6c1ee372****'),
      mediaType?: string(name='MediaType', description='The type of the media asset. Valid values:

*   **video**
*   **audio**
*   **image**
*   **attached**', example='video'),
      video?: {
        appId?: string(name='AppId', description='The ID of the application.', example='app-****'),
        cateId?: long(name='CateId', description='The ID of the category.', example='10000123'),
        cateName?: string(name='CateName', description='The name of the category.', example='video1'),
        coverURL?: string(name='CoverURL', description='The URL of the thumbnail.', example='https://example.aliyundoc.com/image01.png'),
        creationTime?: string(name='CreationTime', description='The time when the video file was created. The time follows the ISO 8601 standard in the *yyyy-MM-dd*T*hh:mm:ss*Z format. The time is displayed in UTC.', example='2018-07-19T03:45:25Z'),
        description?: string(name='Description', description='The description of the video file.', example='Video test'),
        downloadSwitch?: string(name='DownloadSwitch', description='The download switch. The video file can be downloaded offline only when the download switch is turned on. Valid values:

*   **on**
*   **off**', example='on'),
        duration?: float(name='Duration', description='The duration of the video file. Unit: seconds.', example='123'),
        mediaSource?: string(name='MediaSource', description='The source of the video file. Valid values:

*   **general**: The video file is uploaded by using ApsaraVideo VOD.
*   **short_video**: The video file is uploaded by using the short video SDK.
*   **editing**: The video file is produced after online editing.
*   **live**: The video stream is recorded and uploaded as a file.', example='general'),
        modificationTime?: string(name='ModificationTime', description='The time when the video file was updated. The time follows the ISO 8601 standard in the *yyyy-MM-dd*T*hh:mm:ss*Z format. The time is displayed in UTC.', example='2018-07-19T03:48:25Z'),
        preprocessStatus?: string(name='PreprocessStatus', description='The preprocessing status. Valid values:

*   **UnPreprocess**
*   **Preprocessing**
*   **PreprocessSucceed**
*   **PreprocessFailed**', example='Preprocessing'),
        restoreExpiration?: string(name='RestoreExpiration', description='The period of time in which the video file remains in the restored state.', example='2023-03-30T10:14:14Z'),
        restoreStatus?: string(name='RestoreStatus', description='The restoration status of the video file. Valid values:

*   **Processing**
*   **Success**
*   **Failed**', example='Success'),
        size?: long(name='Size', description='The size of the video file.', example='123'),
        snapshots?: [ string ](name='Snapshots', description='The automatic snapshots.'),
        spriteSnapshots?: [ string ](name='SpriteSnapshots', description='The sprite snapshots.'),
        status?: string(name='Status', description='The status of the file. Valid values:

*   **Uploading**
*   **UploadFail**
*   **UploadSucc**
*   **Transcoding**
*   **TranscodeFail**
*   **Blocked**
*   **Normal**', example='UploadSucc'),
        storageClass?: string(name='StorageClass', description='The storage class of the video file. Valid values:

*   **Standard**: All media resources are stored as Standard objects.
*   **IA**: All media resources are stored as IA objects.
*   **Archive**: All media resources are stored as Archive objects.
*   **ColdArchive**: All media resources are stored as Cold Archive objects.
*   **SourceIA**: Only the source file is stored as an IA object.
*   **SourceArchive**: Only the source file is stored as an Archive object.
*   **SourceColdArchive**: Only the source file is stored as a Cold Archive object.
*   **Changing**: The storage class of the video file is being changed.
*   **SourceChanging**: The storage class of the source file is being changed.', example='Standard'),
        storageLocation?: string(name='StorageLocation', description='The region in which the video is stored.', example='outin-bfefbb90a47c******163e1c7426.oss-cn-shanghai.aliyuncs.com'),
        tags?: string(name='Tags', description='The tags of the video file.', example='tag1'),
        title?: string(name='Title', description='The title of the video.', example='ceshi'),
        transcodeMode?: string(name='TranscodeMode', description='The transcoding mode. Valid values:

*   **FastTranscode**: The video file is immediately transcoded after it is uploaded. You cannot play the file before it is transcoded.
*   **NoTranscode**: The video file can be played without being transcoded. You can immediately play the file after it is uploaded.
*   **AsyncTranscode**: The video file can be immediately played and asynchronously transcoded after it is uploaded.', example='FastTranscode'),
        videoId?: string(name='VideoId', description='The ID of the video file.', example='a82a2asdasqadaf3faa0ed6c1ee372****'),
      }(name='Video', description='[The information about the video](https://help.aliyun.com/document_detail/86991.html).'),
    }
  ](name='MediaList', description='The information about the media assets.'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='3E0CEF83-FB09-4E34-BA1451814B03****'),
  scrollToken?: string(name='ScrollToken', description='The pagination identifier.', example='24e0fba7188fae707e146esa54****'),
  total?: long(name='Total', description='The total number of data records that meet the specified filter criteria.', example='10'),
}

model SearchMediaResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: SearchMediaResponseBody(name='body'),
}

/**
 * @summary Queries information about videos, audio, images, and auxiliary media assets. You can call this operation and specify the search protocol to query media assets based on the return fields, fields used for exact match, fields used for fuzzy match, fields used for a multi-value query, fields used for a range query, and sort fields.
 *
 * @description The maximum number of data records that you can query varies based on the method used to query the data. You can use the following methods to query data:
 * *   Method 1: Traverse data by page
 *     You can use the PageNo and PageSize parameters to traverse up to 5,000 data records that meet the specified filter condition. PageNo specifies the page number and PageSize specifies the number of data records displayed on a page. If the number of data records that meet the specified filter condition exceeds 5,000, change the filter conditions to narrow down the results. You cannot use this method to traverse all data records. If you want to traverse more data records, use Method 2.
 * *   Method 2: Traverse all data (available only for audio and video files)
 *     You can use this method to traverse up to 2 million data records related to audio and video files. If the number of data records that meet the specified filter condition exceeds 2 million, change the filter conditions to narrow down the results. To traverse data page by page, you must set the PageNo, PageSize, and ScrollToken parameters. The total number of data records from the current page to the target page cannot exceed 100. For example, you set PageSize to 20. The following content describes the traverse logic:
 *     *   When the PageNo parameter is set to 1, you can traverse data records from page 1 to page 5.
 *     *   When the PageNo parameter is set to 2, you can traverse data records from page 2 to page 6.
 * Make sure that you set the appropriate page number and page size, and use a traverse method based on the number of results that meet your filter condition.
 *
 * @param request SearchMediaRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return SearchMediaResponse
 */
async function searchMediaWithOptions(request: SearchMediaRequest, runtime: $RuntimeOptions): SearchMediaResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.fields)) {
    query['Fields'] = request.fields;
  }
  if (!$isNull(request.match)) {
    query['Match'] = request.match;
  }
  if (!$isNull(request.pageNo)) {
    query['PageNo'] = request.pageNo;
  }
  if (!$isNull(request.pageSize)) {
    query['PageSize'] = request.pageSize;
  }
  if (!$isNull(request.scrollToken)) {
    query['ScrollToken'] = request.scrollToken;
  }
  if (!$isNull(request.searchType)) {
    query['SearchType'] = request.searchType;
  }
  if (!$isNull(request.sortBy)) {
    query['SortBy'] = request.sortBy;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'SearchMedia',
    version = '2017-03-21',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Queries information about videos, audio, images, and auxiliary media assets. You can call this operation and specify the search protocol to query media assets based on the return fields, fields used for exact match, fields used for fuzzy match, fields used for a multi-value query, fields used for a range query, and sort fields.
 *
 * @description The maximum number of data records that you can query varies based on the method used to query the data. You can use the following methods to query data:
 * *   Method 1: Traverse data by page
 *     You can use the PageNo and PageSize parameters to traverse up to 5,000 data records that meet the specified filter condition. PageNo specifies the page number and PageSize specifies the number of data records displayed on a page. If the number of data records that meet the specified filter condition exceeds 5,000, change the filter conditions to narrow down the results. You cannot use this method to traverse all data records. If you want to traverse more data records, use Method 2.
 * *   Method 2: Traverse all data (available only for audio and video files)
 *     You can use this method to traverse up to 2 million data records related to audio and video files. If the number of data records that meet the specified filter condition exceeds 2 million, change the filter conditions to narrow down the results. To traverse data page by page, you must set the PageNo, PageSize, and ScrollToken parameters. The total number of data records from the current page to the target page cannot exceed 100. For example, you set PageSize to 20. The following content describes the traverse logic:
 *     *   When the PageNo parameter is set to 1, you can traverse data records from page 1 to page 5.
 *     *   When the PageNo parameter is set to 2, you can traverse data records from page 2 to page 6.
 * Make sure that you set the appropriate page number and page size, and use a traverse method based on the number of results that meet your filter condition.
 *
 * @param request SearchMediaRequest
 * @return SearchMediaResponse
 */
async function searchMedia(request: SearchMediaRequest): SearchMediaResponse {
  var runtime = new $RuntimeOptions{};
  return searchMediaWithOptions(request, runtime);
}

model SetAuditSecurityIpRequest {
  ips?: string(name='Ips', description='The IP addresses that you want to add to the review security group. You can add a maximum of 100 IP addresses to a review security group. Separate multiple IP addresses with commas (,). You can add IP addresses in the following formats to review security groups:

*   IP address: 192.168.0.1
*   CIDR block: 192.168.0.1/24. /24 indicates that the prefix of the CIDR block is 24 bits in length. You can replace 24 with a value that ranges `from 1 to 32`.

This parameter is required.', example='192.168.0.1'),
  operateMode?: string(name='OperateMode', description='The operation type. Valid values:

*   **Append** (default): adds the IP addresses to the original whitelist.
*   **Cover**: overwrites the original whitelist.
*   **Delete**: removes the IP addresses from the original whitelist.

>  If the value that you specify is invalid, the default value is used.', example='Cover'),
  securityGroupName?: string(name='SecurityGroupName', description='The name of the review security group. Default value: **Default**. You can specify a maximum of 10 review security groups.', example='Default'),
}

model SetAuditSecurityIpResponseBody = {
  requestId?: string(name='RequestId', description='The ID of the request.', example='25818875-5F78-4AF6-D7393642CA58****'),
}

model SetAuditSecurityIpResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: SetAuditSecurityIpResponseBody(name='body'),
}

/**
 * @summary Manages the IP addresses in review security groups.
 *
 * @description You can play videos in the Checking or Blocked state only from the IP addresses that are added to review security groups.
 *
 * @param request SetAuditSecurityIpRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return SetAuditSecurityIpResponse
 */
async function setAuditSecurityIpWithOptions(request: SetAuditSecurityIpRequest, runtime: $RuntimeOptions): SetAuditSecurityIpResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.ips)) {
    query['Ips'] = request.ips;
  }
  if (!$isNull(request.operateMode)) {
    query['OperateMode'] = request.operateMode;
  }
  if (!$isNull(request.securityGroupName)) {
    query['SecurityGroupName'] = request.securityGroupName;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'SetAuditSecurityIp',
    version = '2017-03-21',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Manages the IP addresses in review security groups.
 *
 * @description You can play videos in the Checking or Blocked state only from the IP addresses that are added to review security groups.
 *
 * @param request SetAuditSecurityIpRequest
 * @return SetAuditSecurityIpResponse
 */
async function setAuditSecurityIp(request: SetAuditSecurityIpRequest): SetAuditSecurityIpResponse {
  var runtime = new $RuntimeOptions{};
  return setAuditSecurityIpWithOptions(request, runtime);
}

model SetCrossdomainContentRequest {
  content?: string(name='Content', description='The content of the cross-domain policy file. The file must be in the XML format and can contain up to 2,048 characters.

This parameter is required.', example='&lt;cross-domain-policy&gt;&lt;allow-access-from domain="*"/&gt;&lt;allow-http-request-headers-from domain="*" headers="*" secure="false"/&gt;&lt;/cross-domain-policy&gt;'),
  ownerAccount?: string(name='OwnerAccount'),
  ownerId?: string(name='OwnerId'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: string(name='ResourceOwnerId'),
  resourceRealOwnerId?: string(name='ResourceRealOwnerId', description='The ID of the resource owner.', example='3461111'),
  storageLocation?: string(name='StorageLocation', description='The URL of the Object Storage Service (OSS) bucket.

This parameter is required.', example='outin-67870fd5b****1e98a3900163e1c35d5.oss-cn-shanghai.aliyuncs.com'),
}

model SetCrossdomainContentResponseBody = {
  requestId?: string(name='RequestId', description='The ID of the request.', example='25818875-5F78-4A13-****-D7393642CA58'),
}

model SetCrossdomainContentResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: SetCrossdomainContentResponseBody(name='body'),
}

/**
 * @summary Updates the cross-domain policy file crossdomain.xml.
 *
 * @description > After you use the cross-domain policy file to update the resources on the origin server, you must refresh the resources that are cached on Alibaba Cloud CDN nodes. You can use the ApsaraVideo VOD console to refresh resources. For more information, see [Refresh and prefetch](https://help.aliyun.com/document_detail/86098.html). Alternatively, you can call the [RefreshVodObjectCaches](https://help.aliyun.com/document_detail/69215.html) operation to refresh resources.
 *
 * @param request SetCrossdomainContentRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return SetCrossdomainContentResponse
 */
async function setCrossdomainContentWithOptions(request: SetCrossdomainContentRequest, runtime: $RuntimeOptions): SetCrossdomainContentResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.content)) {
    query['Content'] = request.content;
  }
  if (!$isNull(request.ownerAccount)) {
    query['OwnerAccount'] = request.ownerAccount;
  }
  if (!$isNull(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!$isNull(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!$isNull(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  if (!$isNull(request.resourceRealOwnerId)) {
    query['ResourceRealOwnerId'] = request.resourceRealOwnerId;
  }
  if (!$isNull(request.storageLocation)) {
    query['StorageLocation'] = request.storageLocation;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'SetCrossdomainContent',
    version = '2017-03-21',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Updates the cross-domain policy file crossdomain.xml.
 *
 * @description > After you use the cross-domain policy file to update the resources on the origin server, you must refresh the resources that are cached on Alibaba Cloud CDN nodes. You can use the ApsaraVideo VOD console to refresh resources. For more information, see [Refresh and prefetch](https://help.aliyun.com/document_detail/86098.html). Alternatively, you can call the [RefreshVodObjectCaches](https://help.aliyun.com/document_detail/69215.html) operation to refresh resources.
 *
 * @param request SetCrossdomainContentRequest
 * @return SetCrossdomainContentResponse
 */
async function setCrossdomainContent(request: SetCrossdomainContentRequest): SetCrossdomainContentResponse {
  var runtime = new $RuntimeOptions{};
  return setCrossdomainContentWithOptions(request, runtime);
}

model SetDefaultAITemplateRequest {
  templateId?: string(name='TemplateId', description='The ID of the AI template.

This parameter is required.', example='1706a0063dd733f6a823ef32e0a5****'),
}

model SetDefaultAITemplateResponseBody = {
  requestId?: string(name='RequestId', description='The request ID.', example='8E70E3F8-E2EE-47BC-4677-379D6F28****'),
  templateId?: string(name='TemplateId', description='The ID of the AI template.', example='1706a0063dd733f6a823ef32e0a5****'),
}

model SetDefaultAITemplateResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: SetDefaultAITemplateResponseBody(name='body'),
}

/**
 * @summary Specifies an AI template as the default template.
 *
 * @description Specifies an AI template as the default template.
 *
 * @param request SetDefaultAITemplateRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return SetDefaultAITemplateResponse
 */
async function setDefaultAITemplateWithOptions(request: SetDefaultAITemplateRequest, runtime: $RuntimeOptions): SetDefaultAITemplateResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.templateId)) {
    query['TemplateId'] = request.templateId;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'SetDefaultAITemplate',
    version = '2017-03-21',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Specifies an AI template as the default template.
 *
 * @description Specifies an AI template as the default template.
 *
 * @param request SetDefaultAITemplateRequest
 * @return SetDefaultAITemplateResponse
 */
async function setDefaultAITemplate(request: SetDefaultAITemplateRequest): SetDefaultAITemplateResponse {
  var runtime = new $RuntimeOptions{};
  return setDefaultAITemplateWithOptions(request, runtime);
}

model SetDefaultTranscodeTemplateGroupRequest {
  transcodeTemplateGroupId?: string(name='TranscodeTemplateGroupId', description='The ID of the transcoding template group.

This parameter is required.', example='d58079958be8d*****b699ab7ab6e1bf'),
}

model SetDefaultTranscodeTemplateGroupResponseBody = {
  requestId?: string(name='RequestId', description='The ID of the request.', example='25818875-5F78-4A*****F6-D7393642CA58'),
}

model SetDefaultTranscodeTemplateGroupResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: SetDefaultTranscodeTemplateGroupResponseBody(name='body'),
}

/**
 * @summary Specifies a transcoding template group as the default one.
 *
 * @param request SetDefaultTranscodeTemplateGroupRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return SetDefaultTranscodeTemplateGroupResponse
 */
async function setDefaultTranscodeTemplateGroupWithOptions(request: SetDefaultTranscodeTemplateGroupRequest, runtime: $RuntimeOptions): SetDefaultTranscodeTemplateGroupResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.transcodeTemplateGroupId)) {
    query['TranscodeTemplateGroupId'] = request.transcodeTemplateGroupId;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'SetDefaultTranscodeTemplateGroup',
    version = '2017-03-21',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Specifies a transcoding template group as the default one.
 *
 * @param request SetDefaultTranscodeTemplateGroupRequest
 * @return SetDefaultTranscodeTemplateGroupResponse
 */
async function setDefaultTranscodeTemplateGroup(request: SetDefaultTranscodeTemplateGroupRequest): SetDefaultTranscodeTemplateGroupResponse {
  var runtime = new $RuntimeOptions{};
  return setDefaultTranscodeTemplateGroupWithOptions(request, runtime);
}

model SetDefaultWatermarkRequest {
  watermarkId?: string(name='WatermarkId', description='The ID of the watermark template. You can specify only one watermark template ID. You can obtain the ID by using one of the following methods:

*   Obtain the watermark template ID from the response to the [AddWatermark](~~AddWatermark~~) operation that you call to create a watermark template.
*   Obtain the watermark template ID from the response to the [ListWatermark](~~ListWatermark~~) operation that you call to query all watermark templates within your account.

This parameter is required.', example='9bcc8bfadb843f*****09a2671d0df97'),
}

model SetDefaultWatermarkResponseBody = {
  requestId?: string(name='RequestId', description='The ID of the request.', example='25818875-5F78-4A*****F6-D7393642CA58'),
}

model SetDefaultWatermarkResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: SetDefaultWatermarkResponseBody(name='body'),
}

/**
 * @summary Sets a watermark template as the default one.
 *
 * @param request SetDefaultWatermarkRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return SetDefaultWatermarkResponse
 */
async function setDefaultWatermarkWithOptions(request: SetDefaultWatermarkRequest, runtime: $RuntimeOptions): SetDefaultWatermarkResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.watermarkId)) {
    query['WatermarkId'] = request.watermarkId;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'SetDefaultWatermark',
    version = '2017-03-21',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Sets a watermark template as the default one.
 *
 * @param request SetDefaultWatermarkRequest
 * @return SetDefaultWatermarkResponse
 */
async function setDefaultWatermark(request: SetDefaultWatermarkRequest): SetDefaultWatermarkResponse {
  var runtime = new $RuntimeOptions{};
  return setDefaultWatermarkWithOptions(request, runtime);
}

model SetEditingProjectMaterialsRequest {
  materialIds?: string(name='MaterialIds', description='The ID of the media asset. You can specify IDs of media assets such as videos, images, or auxiliary media assets. Separate multiple IDs with commas (,).

This parameter is required.', example='9e3101bf24bf41c*****123318788ca'),
  ownerAccount?: string(name='OwnerAccount'),
  ownerId?: string(name='OwnerId'),
  projectId?: string(name='ProjectId', description='The ID of the online editing project.

This parameter is required.', example='fb2101bf24bf4*****754cb318787dc'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: string(name='ResourceOwnerId'),
}

model SetEditingProjectMaterialsResponseBody = {
  requestId?: string(name='RequestId', description='The ID of the request.', example='746FFA07-8BBB-46*****B1-3E94E3B2915E'),
}

model SetEditingProjectMaterialsResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: SetEditingProjectMaterialsResponseBody(name='body'),
}

/**
 * @summary Specifies the media assets that you want to edit in an online editing project.
 *
 * @param request SetEditingProjectMaterialsRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return SetEditingProjectMaterialsResponse
 */
async function setEditingProjectMaterialsWithOptions(request: SetEditingProjectMaterialsRequest, runtime: $RuntimeOptions): SetEditingProjectMaterialsResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.materialIds)) {
    query['MaterialIds'] = request.materialIds;
  }
  if (!$isNull(request.ownerAccount)) {
    query['OwnerAccount'] = request.ownerAccount;
  }
  if (!$isNull(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!$isNull(request.projectId)) {
    query['ProjectId'] = request.projectId;
  }
  if (!$isNull(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!$isNull(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'SetEditingProjectMaterials',
    version = '2017-03-21',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Specifies the media assets that you want to edit in an online editing project.
 *
 * @param request SetEditingProjectMaterialsRequest
 * @return SetEditingProjectMaterialsResponse
 */
async function setEditingProjectMaterials(request: SetEditingProjectMaterialsRequest): SetEditingProjectMaterialsResponse {
  var runtime = new $RuntimeOptions{};
  return setEditingProjectMaterialsWithOptions(request, runtime);
}

model SetMessageCallbackRequest {
  appId?: string(name='AppId', description='The ID of the application. If you leave this parameter empty, the default value **app-1000000** is used.', example='app-1000000'),
  authKey?: string(name='AuthKey', description='The authentication key. The key can be up to 32 characters in length and must contain uppercase letters, lowercase letters, and digits. This parameter takes effect only when you set CallbackType to **HTTP**.', example='Dsf346dvet'),
  authSwitch?: string(name='AuthSwitch', description='Specifies whether to enable callback authentication. This parameter takes effect only when you set CallbackType to **HTTP**. Valid values:

*   **on**
*   **off**', example='on'),
  callbackType?: string(name='CallbackType', description='The callback method. Valid values:

*   **HTTP**
*   **Simple Message Queue(formerly MNS)**', example='HTTP'),
  callbackURL?: string(name='CallbackURL', description='The callback URL. This parameter is required if you set CallbackType to **HTTP**. The callback URL cannot exceed 256 bytes in length. You can specify only one callback URL.', example='http://developer.aliyundoc.com'),
  eventTypeList?: string(name='EventTypeList', description='The type of the callback event. If you do not set this parameter, notifications for all types of events are disabled. If you set this parameter to **ALL**, notifications for all types of events are enabled. You can specify the event types for which notifications are enabled. Separate multiple event types with commas (,). For more information about the valid values of this parameter, see [Overview](https://help.aliyun.com/document_detail/55627.html).', example='FileUploadComplete'),
  mnsEndpoint?: string(name='MnsEndpoint', description='The public endpoint of Message Service (MNS). This parameter only takes effect when the CallbackType parameter is set to **Simple Message Queue(formerly MNS)**. To obtain the public endpoint, log on to the [Simple Message Queue(formerly MNS) console](https://account.aliyun.com/login/login.html) and click **Get Endpoint** in the upper-right corner of the Topics page. For more information, see [Endpoint](https://help.aliyun.com/document_detail/27480.html).', example='http://****.mns.cn-shanghai.aliyuncs.com/'),
  mnsQueueName?: string(name='MnsQueueName', description='The name of the Simple Message Queue(formerly MNS). You can obtain the name of the Simple Message Queue(formerly MNS) on the **Queues** page in the [Simple Message Queue(formerly MNS) console](https://account.aliyun.com/login/login.html). This parameter is required when you set CallbackType to **Simple Message Queue(formerly MNS)**.', example='quene_name'),
  ownerAccount?: string(name='OwnerAccount'),
}

model SetMessageCallbackResponseBody = {
  requestId?: string(name='RequestId', description='The ID of the request.', example='25818875-5F78-4AF6-D7393642CA58****'),
}

model SetMessageCallbackResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: SetMessageCallbackResponseBody(name='body'),
}

/**
 * @summary Sets the callback method, callback URL, and event type of an event notification.
 *
 * @description HTTP callbacks and MNS callbacks are supported. For more information, see [Overview](https://help.aliyun.com/document_detail/55627.html).
 *
 * @param request SetMessageCallbackRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return SetMessageCallbackResponse
 */
async function setMessageCallbackWithOptions(request: SetMessageCallbackRequest, runtime: $RuntimeOptions): SetMessageCallbackResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.appId)) {
    query['AppId'] = request.appId;
  }
  if (!$isNull(request.authKey)) {
    query['AuthKey'] = request.authKey;
  }
  if (!$isNull(request.authSwitch)) {
    query['AuthSwitch'] = request.authSwitch;
  }
  if (!$isNull(request.callbackType)) {
    query['CallbackType'] = request.callbackType;
  }
  if (!$isNull(request.callbackURL)) {
    query['CallbackURL'] = request.callbackURL;
  }
  if (!$isNull(request.eventTypeList)) {
    query['EventTypeList'] = request.eventTypeList;
  }
  if (!$isNull(request.mnsEndpoint)) {
    query['MnsEndpoint'] = request.mnsEndpoint;
  }
  if (!$isNull(request.mnsQueueName)) {
    query['MnsQueueName'] = request.mnsQueueName;
  }
  if (!$isNull(request.ownerAccount)) {
    query['OwnerAccount'] = request.ownerAccount;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'SetMessageCallback',
    version = '2017-03-21',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Sets the callback method, callback URL, and event type of an event notification.
 *
 * @description HTTP callbacks and MNS callbacks are supported. For more information, see [Overview](https://help.aliyun.com/document_detail/55627.html).
 *
 * @param request SetMessageCallbackRequest
 * @return SetMessageCallbackResponse
 */
async function setMessageCallback(request: SetMessageCallbackRequest): SetMessageCallbackResponse {
  var runtime = new $RuntimeOptions{};
  return setMessageCallbackWithOptions(request, runtime);
}

model SetVodDomainCertificateRequest {
  certName?: string(name='CertName', description='The name of the certificate.', example='cert_name'),
  domainName?: string(name='DomainName', description='The domain name that is secured by the certificate. The domain name must use HTTPS acceleration.

This parameter is required.', example='example.com'),
  ownerId?: long(name='OwnerId'),
  SSLPri?: string(name='SSLPri', description='The private key. This parameter is required only if you enable the SSL certificate.', example='****'),
  SSLProtocol?: string(name='SSLProtocol', description='Specifies whether to enable the SSL certificate. Default value: off. Valid values:

*   **on**
*   **off**

This parameter is required.', example='off'),
  SSLPub?: string(name='SSLPub', description='The content of the certificate. This parameter is required only if you enable the SSL certificate.', example='****'),
  securityToken?: string(name='SecurityToken'),
}

model SetVodDomainCertificateResponseBody = {
  requestId?: string(name='RequestId', description='The ID of the request.', example='04F0F334-1335-436C-****-6C044FE73368'),
}

model SetVodDomainCertificateResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: SetVodDomainCertificateResponseBody(name='body'),
}

/**
 * @summary Enables or disables the certificate of a domain name and modifies the certificate information.
 *
 * @description > This operation is available only in the **China (Shanghai)** region.
 *
 * @param request SetVodDomainCertificateRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return SetVodDomainCertificateResponse
 */
async function setVodDomainCertificateWithOptions(request: SetVodDomainCertificateRequest, runtime: $RuntimeOptions): SetVodDomainCertificateResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.certName)) {
    query['CertName'] = request.certName;
  }
  if (!$isNull(request.domainName)) {
    query['DomainName'] = request.domainName;
  }
  if (!$isNull(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!$isNull(request.SSLPri)) {
    query['SSLPri'] = request.SSLPri;
  }
  if (!$isNull(request.SSLProtocol)) {
    query['SSLProtocol'] = request.SSLProtocol;
  }
  if (!$isNull(request.SSLPub)) {
    query['SSLPub'] = request.SSLPub;
  }
  if (!$isNull(request.securityToken)) {
    query['SecurityToken'] = request.securityToken;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'SetVodDomainCertificate',
    version = '2017-03-21',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Enables or disables the certificate of a domain name and modifies the certificate information.
 *
 * @description > This operation is available only in the **China (Shanghai)** region.
 *
 * @param request SetVodDomainCertificateRequest
 * @return SetVodDomainCertificateResponse
 */
async function setVodDomainCertificate(request: SetVodDomainCertificateRequest): SetVodDomainCertificateResponse {
  var runtime = new $RuntimeOptions{};
  return setVodDomainCertificateWithOptions(request, runtime);
}

model SetVodDomainSSLCertificateRequest {
  certId?: long(name='CertId', description='The ID of the certificate.', example='12342707'),
  certName?: string(name='CertName', description='The name of the certificate.', example='cert_name'),
  certRegion?: string(name='CertRegion', description='The region of the certificate. Valid values:

*   **ap-southeast-1**: Singapore
*   **cn-hangzhou**: China (Hangzhou)

Default value: **cn-hangzhou**', example='cn-hangzhou'),
  certType?: string(name='CertType', description='The type of the certificate.

*   **upload**: a user-uploaded SSL certificate.
*   **cas**: a certificate that is acquired through Certificate Management Service.', example='cas'),
  domainName?: string(name='DomainName', description='VOD acceleration domain.

This parameter is required.', example='example.com'),
  env?: string(name='Env', description='Specifies whether the certificate is issued in canary releases. If you set this parameter to **staging**, the certificate is issued in canary releases. If you do not specify this parameter or set this parameter to other values, the certificate is officially issued.', example='staging'),
  ownerId?: long(name='OwnerId'),
  SSLPri?: string(name='SSLPri', description='The private key. This parameter is required only if you enable the certificate.', example='****'),
  SSLProtocol?: string(name='SSLProtocol', description='Specifies whether to enable the SSL certificate. Default value: off. Valid values:

*   **on**
*   **off**

This parameter is required.', example='off'),
  SSLPub?: string(name='SSLPub', description='The content of the certificate. This parameter is required only if you enable the SSL certificate.', example='****'),
  securityToken?: string(name='SecurityToken'),
}

model SetVodDomainSSLCertificateResponseBody = {
  requestId?: string(name='RequestId', description='The ID of the request.', example='F4C6D5BE-BF13-45*****6C-516EA8906DCD'),
}

model SetVodDomainSSLCertificateResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: SetVodDomainSSLCertificateResponseBody(name='body'),
}

/**
 * @summary Enables or disables the SSL certificate of a domain name and updates the certificate information.
 *
 * @param request SetVodDomainSSLCertificateRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return SetVodDomainSSLCertificateResponse
 */
async function setVodDomainSSLCertificateWithOptions(request: SetVodDomainSSLCertificateRequest, runtime: $RuntimeOptions): SetVodDomainSSLCertificateResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.certId)) {
    query['CertId'] = request.certId;
  }
  if (!$isNull(request.certName)) {
    query['CertName'] = request.certName;
  }
  if (!$isNull(request.certRegion)) {
    query['CertRegion'] = request.certRegion;
  }
  if (!$isNull(request.certType)) {
    query['CertType'] = request.certType;
  }
  if (!$isNull(request.domainName)) {
    query['DomainName'] = request.domainName;
  }
  if (!$isNull(request.env)) {
    query['Env'] = request.env;
  }
  if (!$isNull(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!$isNull(request.SSLPri)) {
    query['SSLPri'] = request.SSLPri;
  }
  if (!$isNull(request.SSLProtocol)) {
    query['SSLProtocol'] = request.SSLProtocol;
  }
  if (!$isNull(request.SSLPub)) {
    query['SSLPub'] = request.SSLPub;
  }
  if (!$isNull(request.securityToken)) {
    query['SecurityToken'] = request.securityToken;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'SetVodDomainSSLCertificate',
    version = '2017-03-21',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Enables or disables the SSL certificate of a domain name and updates the certificate information.
 *
 * @param request SetVodDomainSSLCertificateRequest
 * @return SetVodDomainSSLCertificateResponse
 */
async function setVodDomainSSLCertificate(request: SetVodDomainSSLCertificateRequest): SetVodDomainSSLCertificateResponse {
  var runtime = new $RuntimeOptions{};
  return setVodDomainSSLCertificateWithOptions(request, runtime);
}

model SubmitAIImageAuditJobRequest {
  mediaAuditConfiguration?: string(name='MediaAuditConfiguration', description='The configuration information about the review job.

*   Other configuration items of the review job. Only the ResourceType field is supported. This field is used to specify the type of media files. You can adjust review standards and rules based on the type of media files.
*   The value of ResourceType can contain only letters, digits, and underscores (_).

> *   You can specify a value for the ResourceType field based on the preceding limits. After you specify a value for the ResourceType field, you must [submit a ticket](https://yida.alibaba-inc.com/o/ticketapply). The value takes effect after Alibaba Cloud processes your ticket.
>*   If you want to change moderation policies and rules based on ResourceType, [submit a ticket](https://yida.alibaba-inc.com/o/ticketapply) to contact technical support.', example='{"ResourceType":"****_short_video"}'),
  mediaId?: string(name='MediaId', description='The ID of the image.

The unique ID of the image is returned after the image is uploaded to ApsaraVideo VOD.

This parameter is required.', example='f1aa3024aee64*****6dc8ca20dbc320'),
  ownerAccount?: string(name='OwnerAccount'),
  ownerId?: string(name='OwnerId'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: string(name='ResourceOwnerId'),
  templateId?: string(name='TemplateId', description='The ID of the AI template. You can use one of the following methods to obtain the ID:

*   Obtain the value of TemplateId from the response to the [AddAITemplate](https://help.aliyun.com/document_detail/102930.html) operation that you call to create an AI template.
*   Obtain the value of TemplateId from the response to the [ListAITemplate](https://help.aliyun.com/document_detail/102936.html) operation that you call to create an AI template.

This parameter is required.', example='VOD-0003-00****'),
}

model SubmitAIImageAuditJobResponseBody = {
  jobId?: string(name='JobId', description='The ID of the image review job.', example='b1aa3024aee64*****6dc8ca20dbc328'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='6F42D500-1956-4B*****30-C09E755F4F4B'),
}

model SubmitAIImageAuditJobResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: SubmitAIImageAuditJobResponseBody(name='body'),
}

/**
 * @summary Submits an automated review job for an image. After the job is submitted, the job is processed in an asynchronous manner. The operation may return a response before the job is complete.
 *
 * @description This operation is available only in the Singapore region.
 *
 * @param request SubmitAIImageAuditJobRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return SubmitAIImageAuditJobResponse
 */
async function submitAIImageAuditJobWithOptions(request: SubmitAIImageAuditJobRequest, runtime: $RuntimeOptions): SubmitAIImageAuditJobResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.mediaAuditConfiguration)) {
    query['MediaAuditConfiguration'] = request.mediaAuditConfiguration;
  }
  if (!$isNull(request.mediaId)) {
    query['MediaId'] = request.mediaId;
  }
  if (!$isNull(request.ownerAccount)) {
    query['OwnerAccount'] = request.ownerAccount;
  }
  if (!$isNull(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!$isNull(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!$isNull(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  if (!$isNull(request.templateId)) {
    query['TemplateId'] = request.templateId;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'SubmitAIImageAuditJob',
    version = '2017-03-21',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Submits an automated review job for an image. After the job is submitted, the job is processed in an asynchronous manner. The operation may return a response before the job is complete.
 *
 * @description This operation is available only in the Singapore region.
 *
 * @param request SubmitAIImageAuditJobRequest
 * @return SubmitAIImageAuditJobResponse
 */
async function submitAIImageAuditJob(request: SubmitAIImageAuditJobRequest): SubmitAIImageAuditJobResponse {
  var runtime = new $RuntimeOptions{};
  return submitAIImageAuditJobWithOptions(request, runtime);
}

model SubmitAIImageJobRequest {
  AIPipelineId?: string(name='AIPipelineId', description='The ID of the pipeline that is used for the AI processing job.

>  This parameter is optional if you specify a default pipeline ID. If you want to use a separate pipeline to submit multiple AI processing jobs., submit a ticket or contact Alibaba Cloud after-sales engineers. For more information about how to submit a ticket, see [Contact us](https://help.aliyun.com/document_detail/464625.html).', example='6492025b8f*****6ba5bb755a33438'),
  AITemplateId?: string(name='AITemplateId', description='The ID of the AI template. You can use one of the following methods to obtain the ID:

*   Obtain the value of TemplateId from the response to the [AddAITemplate](https://help.aliyun.com/document_detail/102930.html) that you call to create the template.
*   Obtain the value of TemplateId from the response to the [ListAITemplate](https://help.aliyun.com/document_detail/102936.html) operation after you create the template.

This parameter is required.', example='ef1a8842cb9f*****cea80cad902e416'),
  ownerAccount?: string(name='OwnerAccount'),
  ownerId?: string(name='OwnerId'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: string(name='ResourceOwnerId'),
  userData?: string(name='UserData', description='The user data.

*   The value must be a JSON string.
*   You must specify the MessageCallback or Extend parameter.
*   The value can contain a maximum of 512 bytes.

For more information, see the "UserData: specifies the custom configurations for media upload" section of the [Request parameters](https://help.aliyun.com/document_detail/86952.html) topic.', example='{"Extend":{"localId":"****","test":"www"}}'),
  videoId?: string(name='VideoId', description='The ID of the video. You can use one of the following methods to obtain the ID:

*   Log on to the [ApsaraVideo VOD](https://vod.console.aliyun.com) console. In the left-side navigation pane, choose **Media Files** > **Audio/Video**. On the Video and Audio page, view the ID of the video file. This method is applicable to files that are uploaded by using the ApsaraVideo VOD console.
*   Obtain the value of VideoId from the response to the [CreateUploadVideo](https://help.aliyun.com/document_detail/55407.html) operation that you call to upload the video.
*   Obtain the value of VideoId from the response to the [SearchMedia](https://help.aliyun.com/document_detail/86044.html) operation after you upload the video.

This parameter is required.', example='357a8748c5774*****89d2726e6436aa'),
}

model SubmitAIImageJobResponseBody = {
  jobId?: string(name='JobId', description='The ID of the image AI processing job.', example='cf08a2c6e11e*****de1711b738b9067'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='218A6807-A21E-43*****54-C0512880B0B0'),
}

model SubmitAIImageJobResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: SubmitAIImageJobResponseBody(name='body'),
}

/**
 * @summary Submits jobs of image AI processing.
 *
 * @description *   Regions that support this operation: **China (Beijing)** and **China (Shanghai)**.
 * *   After you call this operation, you can call the [GetAIImageJobs](https://help.aliyun.com/document_detail/186923.html) operation to query the job execution result.
 *
 * @param request SubmitAIImageJobRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return SubmitAIImageJobResponse
 */
async function submitAIImageJobWithOptions(request: SubmitAIImageJobRequest, runtime: $RuntimeOptions): SubmitAIImageJobResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.AIPipelineId)) {
    query['AIPipelineId'] = request.AIPipelineId;
  }
  if (!$isNull(request.AITemplateId)) {
    query['AITemplateId'] = request.AITemplateId;
  }
  if (!$isNull(request.ownerAccount)) {
    query['OwnerAccount'] = request.ownerAccount;
  }
  if (!$isNull(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!$isNull(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!$isNull(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  if (!$isNull(request.userData)) {
    query['UserData'] = request.userData;
  }
  if (!$isNull(request.videoId)) {
    query['VideoId'] = request.videoId;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'SubmitAIImageJob',
    version = '2017-03-21',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Submits jobs of image AI processing.
 *
 * @description *   Regions that support this operation: **China (Beijing)** and **China (Shanghai)**.
 * *   After you call this operation, you can call the [GetAIImageJobs](https://help.aliyun.com/document_detail/186923.html) operation to query the job execution result.
 *
 * @param request SubmitAIImageJobRequest
 * @return SubmitAIImageJobResponse
 */
async function submitAIImageJob(request: SubmitAIImageJobRequest): SubmitAIImageJobResponse {
  var runtime = new $RuntimeOptions{};
  return submitAIImageJobWithOptions(request, runtime);
}

model SubmitAIJobRequest {
  config?: string(name='Config', description='The configurations of the AI job. The value is a JSON string.

*   If you set `Types` to `AIVideoTag`, you can specify `AnalyseTypes` for `Config` to set the analysis algorithm of a smart tagging job. Valid values:

    *   ASR: automatic speech recognition (ASR)
    *   OCR: image optical character recognition (OCR)

*   If you set `Types` to `AIMediaDNA`, you can specify `DNADBId` for `Config` to set the ID of the media fingerprint library for video fingerprinting jobs.', example='{"AIVideoTag": {"AnalyseTypes": "Face,ASR"} }'),
  mediaId?: string(name='MediaId', description='The ID of the video. You can use one of the following methods to obtain the ID:

*   Log on to the [ApsaraVideo VOD](https://vod.console.aliyun.com) console. In the left-side navigation pane, choose **Media Files** > **Audio/Video**. On the Video and Audio page, view the ID of the audio or video file. This method is applicable to files that are uploaded by using the ApsaraVideo VOD console.
*   Obtain the value of VideoId from the response to the [CreateUploadVideo](https://help.aliyun.com/document_detail/55407.html) operation that you call to upload media files.
*   Obtain the value of VideoId from the response to the [SearchMedia](https://help.aliyun.com/document_detail/86044.html) operation after you upload media files.', example='3D3D12340d9401fab46a0b847****'),
  ownerAccount?: string(name='OwnerAccount'),
  ownerId?: string(name='OwnerId'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: string(name='ResourceOwnerId'),
  types?: string(name='Types', description='The type of the AI job. Separate multiple types with commas (,). Valid values:

*   **AIMediaDNA**: The media fingerprinting job.
*   **AIVideoTag**: The smart tagging job.', example='AIVideoTag'),
  userData?: string(name='UserData', description='The custom settings. The value is a JSON string. For more information, see [Request parameters](~~86952#h2--userdata-div-id-userdata-div-3~~).', example='{"Extend":{"localId":"***","test":"www"}}'),
}

model SubmitAIJobResponseBody = {
  AIJobList?: {
    AIJob?: [ 
    {
      jobId?: string(name='JobId', description='The ID of the AI job.', example='9e82640c85114bf5af23edfaf****'),
      mediaId?: string(name='MediaId', description='The ID of the video.', example='3D3D12340d92c641401fab46a0b847****'),
      type?: string(name='Type', description='The type of the AI job. Valid values:

*   **AIMediaDNA**: The media fingerprinting job.
*   **AIVideoTag**: The smart tagging job.', example='AIVideoTag'),
    }
  ](name='AIJob')
  }(name='AIJobList', description='The information about the AI jobs.'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='25818875-5F78-4A13-BEF6-D73936****'),
}

model SubmitAIJobResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: SubmitAIJobResponseBody(name='body'),
}

/**
 * @summary Submits a smart tagging or video fingerprinting job.
 *
 * @description *   **Make sure that you understand the billing method and price of ApsaraVideo VOD before you call this operation. You are charged for using the smart tagging and video fingerprinting features. For more information, see [Billing of video AI](~~188310#section-g7l-s3o-9ng~~).**
 * *   Regions that support the video fingerprinting feature: **China (Beijing)**, **China (Shanghai)**, and **Singapore**. Regions that support the smart tagging feature: **China (Beijing)** and **China (Shanghai)**.
 * *   You need to enable the video fingerprinting feature or the smart tagging feature before you can call this operation to submit jobs. For more information, see [Overview](https://help.aliyun.com/document_detail/101148.html).
 * *   If this is the first time you use the video fingerprinting feature, you must submit a ticket to apply for using the media fingerprint library for free. Otherwise, the video fingerprinting feature will be affected. For more information about how to submit a ticket, see [Contact us](https://help.aliyun.com/document_detail/464625.html).
 * *   After you submit an AI job, ApsaraVideo VOD asynchronously processes the job. The operation may return a response before the job is complete. You can configure the [Event Notification](https://help.aliyun.com/document_detail/55627.html) feature and set the callback event to **AI Processing Completed**. After you receive the event notification, you can query the execution result of the AI job.
 *
 * @param request SubmitAIJobRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return SubmitAIJobResponse
 */
async function submitAIJobWithOptions(request: SubmitAIJobRequest, runtime: $RuntimeOptions): SubmitAIJobResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.config)) {
    query['Config'] = request.config;
  }
  if (!$isNull(request.mediaId)) {
    query['MediaId'] = request.mediaId;
  }
  if (!$isNull(request.ownerAccount)) {
    query['OwnerAccount'] = request.ownerAccount;
  }
  if (!$isNull(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!$isNull(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!$isNull(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  if (!$isNull(request.types)) {
    query['Types'] = request.types;
  }
  if (!$isNull(request.userData)) {
    query['UserData'] = request.userData;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'SubmitAIJob',
    version = '2017-03-21',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Submits a smart tagging or video fingerprinting job.
 *
 * @description *   **Make sure that you understand the billing method and price of ApsaraVideo VOD before you call this operation. You are charged for using the smart tagging and video fingerprinting features. For more information, see [Billing of video AI](~~188310#section-g7l-s3o-9ng~~).**
 * *   Regions that support the video fingerprinting feature: **China (Beijing)**, **China (Shanghai)**, and **Singapore**. Regions that support the smart tagging feature: **China (Beijing)** and **China (Shanghai)**.
 * *   You need to enable the video fingerprinting feature or the smart tagging feature before you can call this operation to submit jobs. For more information, see [Overview](https://help.aliyun.com/document_detail/101148.html).
 * *   If this is the first time you use the video fingerprinting feature, you must submit a ticket to apply for using the media fingerprint library for free. Otherwise, the video fingerprinting feature will be affected. For more information about how to submit a ticket, see [Contact us](https://help.aliyun.com/document_detail/464625.html).
 * *   After you submit an AI job, ApsaraVideo VOD asynchronously processes the job. The operation may return a response before the job is complete. You can configure the [Event Notification](https://help.aliyun.com/document_detail/55627.html) feature and set the callback event to **AI Processing Completed**. After you receive the event notification, you can query the execution result of the AI job.
 *
 * @param request SubmitAIJobRequest
 * @return SubmitAIJobResponse
 */
async function submitAIJob(request: SubmitAIJobRequest): SubmitAIJobResponse {
  var runtime = new $RuntimeOptions{};
  return submitAIJobWithOptions(request, runtime);
}

model SubmitAIMediaAuditJobRequest {
  mediaAuditConfiguration?: string(name='MediaAuditConfiguration', description='The configuration information about the review job.

*   Other configuration items of the review job. Only the ResourceType field is supported. This field is used to specify the type of media files. You can adjust review standards and rules based on the type of media files.
*   If you want to modify the review standard and rules based on ResourceType, submit a ticket. For more information, see [Contact us](https://help.aliyun.com/document_detail/464625.html).
*   The value of ResourceType can contain only letters, digits, and underscores (_).', example='{"ResourceType":"****_movie"}'),
  mediaId?: string(name='MediaId', description='The ID of the video file. To obtain the file ID, log on to the [ApsaraVideo VOD console](https://vod.console.aliyun.com) and choose **Review Management** > **Content Moderation** in the left-side navigation pane.

This parameter is required.', example='fe028d09441afffb138cd7ee****'),
  mediaType?: string(name='MediaType', description='The type of the media file. Only **video** is supported.', example='video'),
  templateId?: string(name='TemplateId', description='The ID of the AI template. You can use one of the following methods to obtain the ID of the AI template:

*   Obtain the value of TemplateId from the response to the [AddAITemplate](https://help.aliyun.com/document_detail/102930.html) operation that you call to create an AI template.
*   Obtain the value of TemplateId from the response to the [ListAITemplate](https://help.aliyun.com/document_detail/102936.html) operation that you call to create an AI template.

>  If you do not specify an ID, the ID of the default AI template is used.', example='a07a7f7d7d10eb9fd999e56ecc****'),
  userData?: string(name='UserData', description='The custom settings. The value must be a JSON string. You can configure settings such as message callbacks. For more information, see [UserData](https://help.aliyun.com/document_detail/86952.html).

>  To use the callback configurations specified by this parameter, you must configure an HTTP callback URL and specify the types of the callback events in the ApsaraVideo VOD console. Otherwise, the callback configurations do not take effect. For more information about how to configure HTTP callback settings in the ApsaraVideo VOD console, see [Configure callback settings](https://help.aliyun.com/document_detail/86071.html).', example='{"MessageCallback":{"CallbackURL":"http://test.test.com"},"Extend":{"localId":"xxx","test":"www"}}'),
}

model SubmitAIMediaAuditJobResponseBody = {
  jobId?: string(name='JobId', description='The ID of the job.', example='bdbc266af6893943a70176d92e99****'),
  mediaId?: string(name='MediaId', description='The ID of the media file.', example='fe028d09441afffb138cd7ee****'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='F4631053-8D9F-42B2-4A67281DB88E****'),
}

model SubmitAIMediaAuditJobResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: SubmitAIMediaAuditJobResponseBody(name='body'),
}

/**
 * @summary Submits an automated review job for a media file. After the job is submitted, ApsaraVideo VOD asynchronously processes the job. Therefore, the operation may return a response before the job is complete.
 *
 * @description *   **Make sure that you understand the billing methods and price of ApsaraVideo VOD before you call this operation. You are charged for using the automated review feature. For more information about billing, submit a ticket or contact your account manager.**
 * *   You can call this operation only in the **China (Shanghai)**, **China (Beijing)**, and **Singapore** regions.
 * *   For more information, see [Automated review](https://help.aliyun.com/document_detail/101148.html).
 * *   After an automated review job is complete, the images generated during the review are stored in the VOD bucket for two weeks free of charge. The images are automatically deleted after two weeks.
 *
 * @param request SubmitAIMediaAuditJobRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return SubmitAIMediaAuditJobResponse
 */
async function submitAIMediaAuditJobWithOptions(request: SubmitAIMediaAuditJobRequest, runtime: $RuntimeOptions): SubmitAIMediaAuditJobResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.mediaAuditConfiguration)) {
    query['MediaAuditConfiguration'] = request.mediaAuditConfiguration;
  }
  if (!$isNull(request.mediaId)) {
    query['MediaId'] = request.mediaId;
  }
  if (!$isNull(request.mediaType)) {
    query['MediaType'] = request.mediaType;
  }
  if (!$isNull(request.templateId)) {
    query['TemplateId'] = request.templateId;
  }
  if (!$isNull(request.userData)) {
    query['UserData'] = request.userData;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'SubmitAIMediaAuditJob',
    version = '2017-03-21',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Submits an automated review job for a media file. After the job is submitted, ApsaraVideo VOD asynchronously processes the job. Therefore, the operation may return a response before the job is complete.
 *
 * @description *   **Make sure that you understand the billing methods and price of ApsaraVideo VOD before you call this operation. You are charged for using the automated review feature. For more information about billing, submit a ticket or contact your account manager.**
 * *   You can call this operation only in the **China (Shanghai)**, **China (Beijing)**, and **Singapore** regions.
 * *   For more information, see [Automated review](https://help.aliyun.com/document_detail/101148.html).
 * *   After an automated review job is complete, the images generated during the review are stored in the VOD bucket for two weeks free of charge. The images are automatically deleted after two weeks.
 *
 * @param request SubmitAIMediaAuditJobRequest
 * @return SubmitAIMediaAuditJobResponse
 */
async function submitAIMediaAuditJob(request: SubmitAIMediaAuditJobRequest): SubmitAIMediaAuditJobResponse {
  var runtime = new $RuntimeOptions{};
  return submitAIMediaAuditJobWithOptions(request, runtime);
}

model SubmitDigitalWatermarkExtractJobRequest {
  extractType?: string(name='ExtractType', description='The type of the watermark that you want to extract. Valid values:

*   **TraceMark**: user-tracing watermark
*   **CopyrightMark**: copyright watermark

This parameter is required.', example='TraceMark'),
  mediaId?: string(name='MediaId', description='The ID of the video from which you want to extract the watermark. You can specify only one ID. You can use one of the following methods to obtain the ID:

*   Log on to the [ApsaraVideo VOD console](https://vod.console.aliyun.com). In the left-side navigation pane, choose **Media Files** > **Audio/Video** to view the video ID.
*   Obtain the VideoId from the response to the [SearchMedia](~~SearchMedia~~) operation.

This parameter is required.', example='0222e203cf80f9c22870a4d2c****'),
  ownerAccount?: string(name='OwnerAccount'),
  ownerId?: string(name='OwnerId'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: string(name='ResourceOwnerId'),
}

model SubmitDigitalWatermarkExtractJobResponseBody = {
  jobId?: string(name='JobId', description='The ID of the watermark extraction job.', example='ad90a501b1b9472374ad005046****'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='04F0F334-1335-436C-****-6C044FE73368'),
}

model SubmitDigitalWatermarkExtractJobResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: SubmitDigitalWatermarkExtractJobResponseBody(name='body'),
}

/**
 * @summary Submits a digital watermark extraction job. You can call this operation to asynchronously extract a copyright watermark or user-tracing watermark.
 *
 * @description *   **Make sure that you understand the billing methods and price of ApsaraVideo VOD before you call this operation. You are charged for generating and extracting digital watermarks. For more information, see [Billing](~~188310#62b9c940403se~~).**
 * *   This operation is supported only in the **China (Shanghai)** and **China (Beijing)** regions.
 * *   Before you submit a digital watermark extraction job, make sure that the following conditions are met:
 *     *   The video from which you want to extract the watermark is uploaded to the ApsaraVideo VOD.
 *     *   The video from which you want to extract the watermark is longer than 6 minutes.
 *
 * @param request SubmitDigitalWatermarkExtractJobRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return SubmitDigitalWatermarkExtractJobResponse
 */
async function submitDigitalWatermarkExtractJobWithOptions(request: SubmitDigitalWatermarkExtractJobRequest, runtime: $RuntimeOptions): SubmitDigitalWatermarkExtractJobResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.extractType)) {
    query['ExtractType'] = request.extractType;
  }
  if (!$isNull(request.mediaId)) {
    query['MediaId'] = request.mediaId;
  }
  if (!$isNull(request.ownerAccount)) {
    query['OwnerAccount'] = request.ownerAccount;
  }
  if (!$isNull(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!$isNull(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!$isNull(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'SubmitDigitalWatermarkExtractJob',
    version = '2017-03-21',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Submits a digital watermark extraction job. You can call this operation to asynchronously extract a copyright watermark or user-tracing watermark.
 *
 * @description *   **Make sure that you understand the billing methods and price of ApsaraVideo VOD before you call this operation. You are charged for generating and extracting digital watermarks. For more information, see [Billing](~~188310#62b9c940403se~~).**
 * *   This operation is supported only in the **China (Shanghai)** and **China (Beijing)** regions.
 * *   Before you submit a digital watermark extraction job, make sure that the following conditions are met:
 *     *   The video from which you want to extract the watermark is uploaded to the ApsaraVideo VOD.
 *     *   The video from which you want to extract the watermark is longer than 6 minutes.
 *
 * @param request SubmitDigitalWatermarkExtractJobRequest
 * @return SubmitDigitalWatermarkExtractJobResponse
 */
async function submitDigitalWatermarkExtractJob(request: SubmitDigitalWatermarkExtractJobRequest): SubmitDigitalWatermarkExtractJobResponse {
  var runtime = new $RuntimeOptions{};
  return submitDigitalWatermarkExtractJobWithOptions(request, runtime);
}

model SubmitDynamicImageJobRequest {
  dynamicImageTemplateId?: string(name='DynamicImageTemplateId', description='The ID of the frame animation template.

This parameter is required.', example='1a443dc52ef10abc4794d700*****'),
  overrideParams?: string(name='OverrideParams', description='The override parameter. Specify the value in the JSON format. For more information, see [Parameters for media processing](https://help.aliyun.com/document_detail/98618.html). You can use this parameter to override configurations in the animated image template. For more information, see the "DynamicImageTemplateConfig: the configurations of an animated sticker template" section of the [Basic data types](https://help.aliyun.com/document_detail/52839.html) topic.', example='{"Watermarks":[{"Content":"UserID: 666**","WatermarkId":"8ca03c884944bd05efccc312367****"}]}'),
  videoId?: string(name='VideoId', description='The ID of the video. You can use one of the following methods to obtain the ID:

*   Log on to the [ApsaraVideo VOD](https://vod.console.aliyun.com) console. In the left-side navigation pane, choose **Media Files** > **Audio/Video**. On the Video and Audio page, view the ID of the media file. This method is applicable to files that are uploaded by using the ApsaraVideo VOD console.
*   Obtain the value of VideoId from the response to the [CreateUploadVideo](https://help.aliyun.com/document_detail/55407.html) operation that you call to upload media files.
*   Obtain the value of VideoId from the response to the [SearchMedia](https://help.aliyun.com/document_detail/86044.html) operation after you upload media files.

This parameter is required.', example='7d2fbc3e273441bdb0e08e55f8****'),
}

model SubmitDynamicImageJobResponseBody = {
  dynamicImageJob?: {
    jobId?: string(name='JobId', description='The ID of the animated image job.', example='ad90a501b1bfb72374ad0050746****'),
  }(name='DynamicImageJob', description='The information about the animated image job.'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='25818875-5F78-74A6-BEF6-D7393642****'),
}

model SubmitDynamicImageJobResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: SubmitDynamicImageJobResponseBody(name='body'),
}

/**
 * @summary Submits a frame animation job and starts asynchronous processing.
 *
 * @description *   You can capture a part of a video and generate animated images only when the video is in the **Uploaded**, **Transcoding**, **Normal**, **Reviewing**, or **Flagged** state.
 * *   The fees for frame animation are included in your video transcoding bill. You are charged based on the output resolution and the duration. For more information, see [Billing of basic services](https://help.aliyun.com/document_detail/188308.html).
 * ### QPS limits
 * You can call this operation up to 30 times per second per account. Requests that exceed this limit are dropped and you will experience service interruptions. We recommend that you take note of this limit when you call this operation. For more information, see [QPS limit on API operations](https://help.aliyun.com/document_detail/342790.html).
 *
 * @param request SubmitDynamicImageJobRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return SubmitDynamicImageJobResponse
 */
async function submitDynamicImageJobWithOptions(request: SubmitDynamicImageJobRequest, runtime: $RuntimeOptions): SubmitDynamicImageJobResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.dynamicImageTemplateId)) {
    query['DynamicImageTemplateId'] = request.dynamicImageTemplateId;
  }
  if (!$isNull(request.overrideParams)) {
    query['OverrideParams'] = request.overrideParams;
  }
  if (!$isNull(request.videoId)) {
    query['VideoId'] = request.videoId;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'SubmitDynamicImageJob',
    version = '2017-03-21',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Submits a frame animation job and starts asynchronous processing.
 *
 * @description *   You can capture a part of a video and generate animated images only when the video is in the **Uploaded**, **Transcoding**, **Normal**, **Reviewing**, or **Flagged** state.
 * *   The fees for frame animation are included in your video transcoding bill. You are charged based on the output resolution and the duration. For more information, see [Billing of basic services](https://help.aliyun.com/document_detail/188308.html).
 * ### QPS limits
 * You can call this operation up to 30 times per second per account. Requests that exceed this limit are dropped and you will experience service interruptions. We recommend that you take note of this limit when you call this operation. For more information, see [QPS limit on API operations](https://help.aliyun.com/document_detail/342790.html).
 *
 * @param request SubmitDynamicImageJobRequest
 * @return SubmitDynamicImageJobResponse
 */
async function submitDynamicImageJob(request: SubmitDynamicImageJobRequest): SubmitDynamicImageJobResponse {
  var runtime = new $RuntimeOptions{};
  return submitDynamicImageJobWithOptions(request, runtime);
}

model SubmitMediaDNADeleteJobRequest {
  mediaId?: string(name='MediaId', description='The ID of the video.

This parameter is required.', example='656eaaa8c43a4597******1f09a36'),
  ownerAccount?: string(name='OwnerAccount'),
  ownerId?: string(name='OwnerId'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: string(name='ResourceOwnerId'),
}

model SubmitMediaDNADeleteJobResponseBody = {
  jobId?: string(name='JobId', description='The ID of the job.', example='6805B2EC-CE87-****-8FF6-9C0E97719A26'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='e5b1a2e7bee******b632c2710b9423f'),
}

model SubmitMediaDNADeleteJobResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: SubmitMediaDNADeleteJobResponseBody(name='body'),
}

/**
 * @summary Deletes a video fingerprinting job.
 *
 * @description Regions that support this operation: **China (Beijing)**, **China (Shanghai)**, and **Singapore**.
 *
 * @param request SubmitMediaDNADeleteJobRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return SubmitMediaDNADeleteJobResponse
 */
async function submitMediaDNADeleteJobWithOptions(request: SubmitMediaDNADeleteJobRequest, runtime: $RuntimeOptions): SubmitMediaDNADeleteJobResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.mediaId)) {
    query['MediaId'] = request.mediaId;
  }
  if (!$isNull(request.ownerAccount)) {
    query['OwnerAccount'] = request.ownerAccount;
  }
  if (!$isNull(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!$isNull(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!$isNull(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'SubmitMediaDNADeleteJob',
    version = '2017-03-21',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Deletes a video fingerprinting job.
 *
 * @description Regions that support this operation: **China (Beijing)**, **China (Shanghai)**, and **Singapore**.
 *
 * @param request SubmitMediaDNADeleteJobRequest
 * @return SubmitMediaDNADeleteJobResponse
 */
async function submitMediaDNADeleteJob(request: SubmitMediaDNADeleteJobRequest): SubmitMediaDNADeleteJobResponse {
  var runtime = new $RuntimeOptions{};
  return submitMediaDNADeleteJobWithOptions(request, runtime);
}

model SubmitPreprocessJobsRequest {
  preprocessType?: string(name='PreprocessType', description='The preprocessing type. Set the value to **LivePreprocess**. LivePreprocess specifies that the video is preprocessed in the production studio.

This parameter is required.', example='LivePreprocess'),
  videoId?: string(name='VideoId', description='The ID of the video. You can use one of the following methods to obtain the ID:

*   After you upload a video in the ApsaraVideo VOD console, you can log on to the [ApsaraVideo VOD console](https://vod.console.aliyun.com) and choose **Media Files** > **Audio/Video** to view the ID of the video.
*   Obtain the VideoId from the response to the [CreateUploadVideo](https://help.aliyun.com/document_detail/55407.html) operation that you call to upload videos.
*   Obtain the VideoId from the response to the [SearchMedia](https://help.aliyun.com/document_detail/86044.html) operation that you call to query videos.

This parameter is required.', example='d3e680e618708efbf2cae7cc9312****'),
}

model SubmitPreprocessJobsResponseBody = {
  preprocessJobs?: {
    preprocessJob?: [ 
    {
      jobId?: string(name='JobId', description='The ID of the job.', example='bb396607fd11fee9effbb99c4****'),
    }
  ](name='PreprocessJob')
  }(name='PreprocessJobs', description='The information about the job.'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='E4EBD2BF-5EB0-4476-8829-9D94E1B1****'),
}

model SubmitPreprocessJobsResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: SubmitPreprocessJobsResponseBody(name='body'),
}

/**
 * @summary Transcodes a video by using the production studio.
 *
 * @description *   During video preprocessing, videos are transcoded to meet the playback requirements of the production studio. Therefore, **you are charged for video preprocessing**. For more information about billing, see [Billing of production studios](https://help.aliyun.com/document_detail/64531.html).
 * *   You can obtain the preprocessing result in the [TranscodeComplete](https://help.aliyun.com/document_detail/55638.html) event notification. If **Preprocess=true** is returned in the event notification, the video is transcoded.
 *
 * @param request SubmitPreprocessJobsRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return SubmitPreprocessJobsResponse
 */
async function submitPreprocessJobsWithOptions(request: SubmitPreprocessJobsRequest, runtime: $RuntimeOptions): SubmitPreprocessJobsResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.preprocessType)) {
    query['PreprocessType'] = request.preprocessType;
  }
  if (!$isNull(request.videoId)) {
    query['VideoId'] = request.videoId;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'SubmitPreprocessJobs',
    version = '2017-03-21',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Transcodes a video by using the production studio.
 *
 * @description *   During video preprocessing, videos are transcoded to meet the playback requirements of the production studio. Therefore, **you are charged for video preprocessing**. For more information about billing, see [Billing of production studios](https://help.aliyun.com/document_detail/64531.html).
 * *   You can obtain the preprocessing result in the [TranscodeComplete](https://help.aliyun.com/document_detail/55638.html) event notification. If **Preprocess=true** is returned in the event notification, the video is transcoded.
 *
 * @param request SubmitPreprocessJobsRequest
 * @return SubmitPreprocessJobsResponse
 */
async function submitPreprocessJobs(request: SubmitPreprocessJobsRequest): SubmitPreprocessJobsResponse {
  var runtime = new $RuntimeOptions{};
  return submitPreprocessJobsWithOptions(request, runtime);
}

model SubmitSnapshotJobRequest {
  count?: long(name='Count', description='The maximum number of snapshots. Default value: **1**.', example='1'),
  height?: string(name='Height', description='The height of each snapshot. Valid values: `[8,4096]`. By default, the height of the video source is used. Unit: pixels.', example='720'),
  interval?: long(name='Interval', description='The snapshot interval. The value must be **greater than or equal to 0**.

*   Unit: seconds.
*   Default value: **1**.
*   If you set this parameter to **0**, snapshots are captured at even intervals based on the video duration divided by the value of the Count parameter.', example='1'),
  snapshotTemplateId?: string(name='SnapshotTemplateId', description='The ID of the snapshot template.

*   We recommend that you create a snapshot template before you specify the template ID. For more information about how to create a snapshot template, see [AddVodTemplate](https://help.aliyun.com/document_detail/99406.html).
*   If you set the SnapshotTemplateId parameter, all the other request parameters except the Action and VideoId parameters are ignored.', example='f5b228fe693bf55bd87b789****'),
  specifiedOffsetTime?: long(name='SpecifiedOffsetTime', description='The point in time when the first snapshot is captured.

*   Unit: milliseconds.
*   Default value: **0**.', example='0'),
  specifiedOffsetTimes?: [ long ](name='SpecifiedOffsetTimes', description='The playback positions at which you want to capture snapshots. Unit: milliseconds. You can specify up to 30 playback positions in a request.'),
  spriteSnapshotConfig?: string(name='SpriteSnapshotConfig', description='The sprite snapshot configuration. If you set this parameter, sprite snapshots are generated. For more information, see [SpriteSnapshotConfig](https://help.aliyun.com/document_detail/86952.html).', example='{\\\\"CellWidth\\\\": 120, \\\\"CellHeight\\\\": 68, \\\\"Columns\\\\": 3,\\\\"Lines\\\\": 10, \\\\"Padding\\\\": 20, \\\\"Margin\\\\": 50}'),
  userData?: string(name='UserData', description='The custom configurations including the configuration of transparent data transmission and callback configurations. The value must be a JSON string. For more information, see [UserData](https://help.aliyun.com/document_detail/86952.html).

>  To use the message callback feature, you must specify an HTTP callback URL and the callback events in the ApsaraVideo VOD console. Otherwise, the callback settings do not take effect.', example='{"MessageCallback":{"CallbackURL":"http://.example.aliyundoc.com"},"Extend":{"localId":"xxx","example":"www"}}'),
  videoId?: string(name='VideoId', description='The ID of the video. You can use one of the following methods to obtain the ID:

*   After you upload a video in the ApsaraVideo VOD console, you can log on to the [ApsaraVideo VOD console](https://vod.console.aliyun.com) and choose **Media Files** > **Audio/Video** to view the ID of the video.
*   Obtain the video ID from the response to the [CreateUploadVideo](https://help.aliyun.com/document_detail/55407.html) operation that you called to obtain the upload URL and credential.
*   Obtain the video ID from the response to the [SearchMedia](https://help.aliyun.com/document_detail/86044.html) operation that you called to query media information after the audio or video file is uploaded.', example='d3e680e618708efbf2cae7cc9312****'),
  width?: string(name='Width', description='The width of each snapshot. Valid values: `[8,4096]`. By default, the width of the video source is used. Unit: pixels.', example='1280'),
}

model SubmitSnapshotJobShrinkRequest {
  count?: long(name='Count', description='The maximum number of snapshots. Default value: **1**.', example='1'),
  height?: string(name='Height', description='The height of each snapshot. Valid values: `[8,4096]`. By default, the height of the video source is used. Unit: pixels.', example='720'),
  interval?: long(name='Interval', description='The snapshot interval. The value must be **greater than or equal to 0**.

*   Unit: seconds.
*   Default value: **1**.
*   If you set this parameter to **0**, snapshots are captured at even intervals based on the video duration divided by the value of the Count parameter.', example='1'),
  snapshotTemplateId?: string(name='SnapshotTemplateId', description='The ID of the snapshot template.

*   We recommend that you create a snapshot template before you specify the template ID. For more information about how to create a snapshot template, see [AddVodTemplate](https://help.aliyun.com/document_detail/99406.html).
*   If you set the SnapshotTemplateId parameter, all the other request parameters except the Action and VideoId parameters are ignored.', example='f5b228fe693bf55bd87b789****'),
  specifiedOffsetTime?: long(name='SpecifiedOffsetTime', description='The point in time when the first snapshot is captured.

*   Unit: milliseconds.
*   Default value: **0**.', example='0'),
  specifiedOffsetTimesShrink?: string(name='SpecifiedOffsetTimes', description='The playback positions at which you want to capture snapshots. Unit: milliseconds. You can specify up to 30 playback positions in a request.'),
  spriteSnapshotConfig?: string(name='SpriteSnapshotConfig', description='The sprite snapshot configuration. If you set this parameter, sprite snapshots are generated. For more information, see [SpriteSnapshotConfig](https://help.aliyun.com/document_detail/86952.html).', example='{\\\\"CellWidth\\\\": 120, \\\\"CellHeight\\\\": 68, \\\\"Columns\\\\": 3,\\\\"Lines\\\\": 10, \\\\"Padding\\\\": 20, \\\\"Margin\\\\": 50}'),
  userData?: string(name='UserData', description='The custom configurations including the configuration of transparent data transmission and callback configurations. The value must be a JSON string. For more information, see [UserData](https://help.aliyun.com/document_detail/86952.html).

>  To use the message callback feature, you must specify an HTTP callback URL and the callback events in the ApsaraVideo VOD console. Otherwise, the callback settings do not take effect.', example='{"MessageCallback":{"CallbackURL":"http://.example.aliyundoc.com"},"Extend":{"localId":"xxx","example":"www"}}'),
  videoId?: string(name='VideoId', description='The ID of the video. You can use one of the following methods to obtain the ID:

*   After you upload a video in the ApsaraVideo VOD console, you can log on to the [ApsaraVideo VOD console](https://vod.console.aliyun.com) and choose **Media Files** > **Audio/Video** to view the ID of the video.
*   Obtain the video ID from the response to the [CreateUploadVideo](https://help.aliyun.com/document_detail/55407.html) operation that you called to obtain the upload URL and credential.
*   Obtain the video ID from the response to the [SearchMedia](https://help.aliyun.com/document_detail/86044.html) operation that you called to query media information after the audio or video file is uploaded.', example='d3e680e618708efbf2cae7cc9312****'),
  width?: string(name='Width', description='The width of each snapshot. Valid values: `[8,4096]`. By default, the width of the video source is used. Unit: pixels.', example='1280'),
}

model SubmitSnapshotJobResponseBody = {
  requestId?: string(name='RequestId', description='The ID of the request.', example='25818875-5F78-5EB0-4AF6-D7393642****'),
  snapshotJob?: {
    jobId?: string(name='JobId', description='The ID of the snapshot job.', example='ad90a501b1b94b72374ad0050464****'),
  }(name='SnapshotJob', description='The information about the snapshot job.'),
}

model SubmitSnapshotJobResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: SubmitSnapshotJobResponseBody(name='body'),
}

/**
 * @summary Submits a snapshot job for a video and starts asynchronous snapshot processing.
 *
 * @description *   Only snapshots in the JPG format are generated.
 * *   After a snapshot is captured, the [SnapshotComplete](https://help.aliyun.com/document_detail/57337.html) callback is fired and EventType=SnapshotComplete, SubType=SpecifiedTime is returned.
 * ### [](#qps-)QPS limits
 * You can call this operation up to 30 times per second per account. Requests that exceed this limit are dropped and you will experience service interruptions. We recommend that you take note of this limit when you call this operation. For more information, see [QPS limits](https://help.aliyun.com/document_detail/342790.html).
 *
 * @param tmpReq SubmitSnapshotJobRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return SubmitSnapshotJobResponse
 */
async function submitSnapshotJobWithOptions(tmpReq: SubmitSnapshotJobRequest, runtime: $RuntimeOptions): SubmitSnapshotJobResponse {
  tmpReq.validate();
  var request = new SubmitSnapshotJobShrinkRequest{};
  OpenApiUtil.convert(tmpReq, request);
  if (!$isNull(tmpReq.specifiedOffsetTimes)) {
    request.specifiedOffsetTimesShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.specifiedOffsetTimes, 'SpecifiedOffsetTimes', 'json');
  }
  var query = {};
  if (!$isNull(request.count)) {
    query['Count'] = request.count;
  }
  if (!$isNull(request.height)) {
    query['Height'] = request.height;
  }
  if (!$isNull(request.interval)) {
    query['Interval'] = request.interval;
  }
  if (!$isNull(request.snapshotTemplateId)) {
    query['SnapshotTemplateId'] = request.snapshotTemplateId;
  }
  if (!$isNull(request.specifiedOffsetTime)) {
    query['SpecifiedOffsetTime'] = request.specifiedOffsetTime;
  }
  if (!$isNull(request.specifiedOffsetTimesShrink)) {
    query['SpecifiedOffsetTimes'] = request.specifiedOffsetTimesShrink;
  }
  if (!$isNull(request.spriteSnapshotConfig)) {
    query['SpriteSnapshotConfig'] = request.spriteSnapshotConfig;
  }
  if (!$isNull(request.userData)) {
    query['UserData'] = request.userData;
  }
  if (!$isNull(request.videoId)) {
    query['VideoId'] = request.videoId;
  }
  if (!$isNull(request.width)) {
    query['Width'] = request.width;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'SubmitSnapshotJob',
    version = '2017-03-21',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Submits a snapshot job for a video and starts asynchronous snapshot processing.
 *
 * @description *   Only snapshots in the JPG format are generated.
 * *   After a snapshot is captured, the [SnapshotComplete](https://help.aliyun.com/document_detail/57337.html) callback is fired and EventType=SnapshotComplete, SubType=SpecifiedTime is returned.
 * ### [](#qps-)QPS limits
 * You can call this operation up to 30 times per second per account. Requests that exceed this limit are dropped and you will experience service interruptions. We recommend that you take note of this limit when you call this operation. For more information, see [QPS limits](https://help.aliyun.com/document_detail/342790.html).
 *
 * @param request SubmitSnapshotJobRequest
 * @return SubmitSnapshotJobResponse
 */
async function submitSnapshotJob(request: SubmitSnapshotJobRequest): SubmitSnapshotJobResponse {
  var runtime = new $RuntimeOptions{};
  return submitSnapshotJobWithOptions(request, runtime);
}

model SubmitTranscodeJobsRequest {
  encryptConfig?: string(name='EncryptConfig', description='The encryption configurations. The value must be a JSON string. This parameter is required only when you use HLS encryption.

> 

*   You must set **CipherText** in [EncrptConfig](https://help.aliyun.com/document_detail/86952.html) to the AES_128 cipher text that is obtained from the response to the [GenerateKMSDataKey](https://help.aliyun.com/document_detail/455051.html) operation. Otherwise, the HLS encryption fails. For more information about how to use HLS encryption, see [HLS encryption](https://help.aliyun.com/document_detail/68612.html).

*   You must select HLS encryption for the template specified by **TemplateGroupId** no matter you use HLS encryption or Alibaba Cloud proprietary cryptography. Otherwise, the transcoded file is not encrypted.', example='{"CipherText":"ZjJmZGViNzUtZWY1Mi00Y2RlLTk3****", "DecryptKeyUri":"http://demo.aliyundoc.com?CipherText=ZjJmZGViNzUtZWY1Mi00Y2RlLTk3****","KeyServiceType":"KMS"}'),
  overrideParams?: string(name='OverrideParams', description='The override parameter. The value must be a JSON string. You can use this parameter to override the image watermark, text watermark, or subtitle file specified in the transcoding template, or override the encoding format of the subtitle file. For more information about the data structure, see [OverrideParams](https://help.aliyun.com/document_detail/98618.html).', example='{"Watermarks":[{"WatermarkId":"af2afe4761992c47dae973374****","FileUrl":"http://developer.aliyundoc.com/image/image.png"},{"WatermarkId":"e8e5b8038d7ada85b376c2707****","Content":"watermark test"}]}'),
  pipelineId?: string(name='PipelineId', description='The ID of the queue that you want to use to run the job.', example='d3e680e618708erf45fbf2cae7c****'),
  priority?: string(name='Priority', description='The priority of the transcoding job in all queued jobs.

*   Valid values: **1** to **10**.
*   A value of **10** indicates the highest priority.
*   Default value: **6**.

>  This parameter takes effect only on the queued transcoding jobs. The priorities of the in-progress transcoding jobs are not affected.', example='6'),
  sessionId?: string(name='SessionId', description='The custom identifier for deduplication. If you send a request, an error is returned if a request with the same identifier was sent in the last 7 days. A custom identifier can be up to 50 characters in length and can contain letters, digits, hyphens (-), and underscores (_). If you do not specify this parameter or leave this parameter empty, duplicate requests are not filtered.', example='5c62d40299034bbaa4c195da330****'),
  templateGroupId?: string(name='TemplateGroupId', description='The ID of the transcoding template group that you want to use. To view the template group ID, perform the following operations: Log on to the [ApsaraVideo VOD console](https://vod.console.aliyun.com). In the left-side navigation pane, choose **Configuration Management** > **Media Processing** > **Transcoding Template Groups**.

This parameter is required.', example='0e408c803baf658ee637790c5d9f****'),
  userData?: string(name='UserData', description='The custom settings. The value must be a JSON string. You can configure settings such as message callbacks. For more information, see [UserData](https://help.aliyun.com/document_detail/86952.html).

>  To use the callback configurations specified by this parameter, you must configure an HTTP callback URL and specify the types of the callback events in the ApsaraVideo VOD console. Otherwise, the callback configurations do not take effect.', example='{"Extend":{"localId":"****","test":"***"}}'),
  videoId?: string(name='VideoId', description='The ID of the video file. You can use one of the following methods to obtain the video ID:

*   Log on to the [ApsaraVideo VOD](https://vod.console.aliyun.com) console. In the left-side navigation pane, choose **Media Files** > **Audio/Video**. On the Video and Audio page, view the ID of the video file. This method is applicable to files that are uploaded by using the ApsaraVideo VOD console.
*   Obtain the value of VideoId from the response to the [CreateUploadVideo](https://help.aliyun.com/document_detail/55407.html) operation that you call to upload the video.
*   Obtain the value of VideoId from the response to the [SearchMedia](https://help.aliyun.com/document_detail/86044.html) operation after you upload the video.', example='142710f878bd42508932f660d7b1****'),
}

model SubmitTranscodeJobsResponseBody = {
  requestId?: string(name='RequestId', description='The ID of the request.', example='E4EBD2BF-5EB0-4476-8829-9D94E1B1****'),
  transcodeJobs?: {
    transcodeJob?: [ 
    {
      jobId?: string(name='JobId', description='The ID of the transcoding job.

>  This parameter is not returned for HLS packaging tasks. You must asynchronously receive the transcoding result.', example='d8921ce8505716cfe86fb112c4****'),
    }
  ](name='TranscodeJob')
  }(name='TranscodeJobs', description='The information about the transcoding job.

>  This parameter is not returned for HLS packaging tasks. You must asynchronously receive the transcoding result.'),
  transcodeTaskId?: string(name='TranscodeTaskId', description='The ID of the transcoding task that was submitted.', example='9f4a0df7da2c8a81c8c0408c84****'),
}

model SubmitTranscodeJobsResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: SubmitTranscodeJobsResponseBody(name='body'),
}

/**
 * @summary Submits a transcoding job to start transcoding in an asynchronous manner.
 *
 * @description ### [](#)Usage notes
 * *   **Make sure that you understand the billing methods and prices of ApsaraVideo VOD before you call this operation. For more information about billing of the transcoding feature, see [Billing of basic services](~~188308#section-ejb-nii-nqa~~).**
 * *   You can transcode a video only in the Uploaded, Normal, or Reviewing state.
 * *   You can obtain the transcoding results from the [StreamTranscodeComplete](https://help.aliyun.com/document_detail/55636.html) or [TranscodeComplete](https://help.aliyun.com/document_detail/55638.html) callback.
 * *   You can call this operation to dynamically override the subtitle URL in an HTTP Live Streaming (HLS) packaging task. If the packaging task does not contain subtitles, we recommend that you specify the ID of the specific packaging template group when you upload the video instead of calling this operation.
 *
 * @param request SubmitTranscodeJobsRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return SubmitTranscodeJobsResponse
 */
async function submitTranscodeJobsWithOptions(request: SubmitTranscodeJobsRequest, runtime: $RuntimeOptions): SubmitTranscodeJobsResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.encryptConfig)) {
    query['EncryptConfig'] = request.encryptConfig;
  }
  if (!$isNull(request.overrideParams)) {
    query['OverrideParams'] = request.overrideParams;
  }
  if (!$isNull(request.pipelineId)) {
    query['PipelineId'] = request.pipelineId;
  }
  if (!$isNull(request.priority)) {
    query['Priority'] = request.priority;
  }
  if (!$isNull(request.sessionId)) {
    query['SessionId'] = request.sessionId;
  }
  if (!$isNull(request.templateGroupId)) {
    query['TemplateGroupId'] = request.templateGroupId;
  }
  if (!$isNull(request.userData)) {
    query['UserData'] = request.userData;
  }
  if (!$isNull(request.videoId)) {
    query['VideoId'] = request.videoId;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'SubmitTranscodeJobs',
    version = '2017-03-21',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Submits a transcoding job to start transcoding in an asynchronous manner.
 *
 * @description ### [](#)Usage notes
 * *   **Make sure that you understand the billing methods and prices of ApsaraVideo VOD before you call this operation. For more information about billing of the transcoding feature, see [Billing of basic services](~~188308#section-ejb-nii-nqa~~).**
 * *   You can transcode a video only in the Uploaded, Normal, or Reviewing state.
 * *   You can obtain the transcoding results from the [StreamTranscodeComplete](https://help.aliyun.com/document_detail/55636.html) or [TranscodeComplete](https://help.aliyun.com/document_detail/55638.html) callback.
 * *   You can call this operation to dynamically override the subtitle URL in an HTTP Live Streaming (HLS) packaging task. If the packaging task does not contain subtitles, we recommend that you specify the ID of the specific packaging template group when you upload the video instead of calling this operation.
 *
 * @param request SubmitTranscodeJobsRequest
 * @return SubmitTranscodeJobsResponse
 */
async function submitTranscodeJobs(request: SubmitTranscodeJobsRequest): SubmitTranscodeJobsResponse {
  var runtime = new $RuntimeOptions{};
  return submitTranscodeJobsWithOptions(request, runtime);
}

model SubmitWorkflowJobRequest {
  mediaId?: string(name='MediaId', description='The ID of the media file. You can use one of the following methods to obtain the ID:

*   Log on to the [ApsaraVideo VOD](https://vod.console.aliyun.com) console. In the left-side navigation pane, choose **Media Files** > **Audio/Video**. On the Video and Audio page, view the ID of the audio or video file. This method is applicable to files that are uploaded by using the ApsaraVideo VOD console.
*   Obtain the value of the VideoId parameter when you call the [CreateUploadVideo](https://help.aliyun.com/document_detail/55407.html) operation to upload media files.
*   Obtain the value of the VideoId parameter when you call the [SearchMedia](https://help.aliyun.com/document_detail/86044.html) operation after you upload media files.', example='058b39e75269da42b08f00459****'),
  workflowId?: string(name='WorkflowId', description='The ID of the workflow. To view the ID of the workflow, log on to the [ApsaraVideo VOD console](https://vod.console.aliyun.com). In the left-side navigation pane, choose **Configuration Management** > **Media Processing** > **Workflows**.

This parameter is required.', example='34d577eade633860bdf1237****'),
}

model SubmitWorkflowJobResponseBody = {
  requestId?: string(name='RequestId', description='The ID of the request.', example='A01C8FF4-C106-4431-418F973DADB7****'),
  taskId?: string(name='TaskId'),
}

model SubmitWorkflowJobResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: SubmitWorkflowJobResponseBody(name='body'),
}

/**
 * @summary Initiates a workflow to process media files.
 *
 * @description * **Make sure that you understand the billing method and price of ApsaraVideo VOD before you call this operation. When you use workflows to process videos, you may be charged for transcoding, encryption, and automated review. For more information, see [Billing overview](https://help.aliyun.com/document_detail/188307.html).**
 * * You can call this operation to initiate a VOD workflow to process media files. For more information, see [Workflows](https://help.aliyun.com/document_detail/115347.html).
 *
 * @param request SubmitWorkflowJobRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return SubmitWorkflowJobResponse
 */
async function submitWorkflowJobWithOptions(request: SubmitWorkflowJobRequest, runtime: $RuntimeOptions): SubmitWorkflowJobResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.mediaId)) {
    query['MediaId'] = request.mediaId;
  }
  if (!$isNull(request.workflowId)) {
    query['WorkflowId'] = request.workflowId;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'SubmitWorkflowJob',
    version = '2017-03-21',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Initiates a workflow to process media files.
 *
 * @description * **Make sure that you understand the billing method and price of ApsaraVideo VOD before you call this operation. When you use workflows to process videos, you may be charged for transcoding, encryption, and automated review. For more information, see [Billing overview](https://help.aliyun.com/document_detail/188307.html).**
 * * You can call this operation to initiate a VOD workflow to process media files. For more information, see [Workflows](https://help.aliyun.com/document_detail/115347.html).
 *
 * @param request SubmitWorkflowJobRequest
 * @return SubmitWorkflowJobResponse
 */
async function submitWorkflowJob(request: SubmitWorkflowJobRequest): SubmitWorkflowJobResponse {
  var runtime = new $RuntimeOptions{};
  return submitWorkflowJobWithOptions(request, runtime);
}

model UpdateAITemplateRequest {
  templateConfig?: string(name='TemplateConfig', description='The detailed configurations of the AI template. The value is a JSON string. For more information, see [AITemplateConfig](~~89863#title-vd3-499-o36~~).

This parameter is required.', example='{"AuditItem":["terrorism","porn"],"AuditRange":["text-title","video"],"AuditContent":["screen"],"AuditAutoBlock":"yes"}'),
  templateId?: string(name='TemplateId', description='The ID of the AI template. You can use one of the following methods to obtain the ID:

*   Call the [AddAITemplate](https://help.aliyun.com/document_detail/102930.html) operation to add an AI template if no AI template exists. The value of TemplateId in the response is the ID of the AI template.
*   Call the [ListAITemplate](https://help.aliyun.com/document_detail/102936.html) operation if the template already exists. The value of TemplateId in the response is the ID of the AI template.

This parameter is required.', example='1706a0063dd733f6a823ef32e0a5****'),
  templateName?: string(name='TemplateName', description='The name of the AI template. The name can be up to 128 bytes in length.

This parameter is required.', example='DemoAITemplate'),
}

model UpdateAITemplateResponseBody = {
  requestId?: string(name='RequestId', description='The ID of the request.', example='25818875-5F78-4A13-BEF6-****'),
  templateId?: string(name='TemplateId', description='The ID of the template.', example='1706a0063dd733f6a823ef32e0a5****'),
}

model UpdateAITemplateResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: UpdateAITemplateResponseBody(name='body'),
}

/**
 * @summary Modifies an AI template.
 *
 * @description *   Regions that support this operation: **China (Beijing)**, **China (Shanghai)**, and **Singapore**.
 * *   After you call the [AddAITemplate](https://help.aliyun.com/document_detail/102930.html) operation to add an AI template, you can call this operation to modify the AI template.
 *
 * @param request UpdateAITemplateRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return UpdateAITemplateResponse
 */
async function updateAITemplateWithOptions(request: UpdateAITemplateRequest, runtime: $RuntimeOptions): UpdateAITemplateResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.templateConfig)) {
    query['TemplateConfig'] = request.templateConfig;
  }
  if (!$isNull(request.templateId)) {
    query['TemplateId'] = request.templateId;
  }
  if (!$isNull(request.templateName)) {
    query['TemplateName'] = request.templateName;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'UpdateAITemplate',
    version = '2017-03-21',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Modifies an AI template.
 *
 * @description *   Regions that support this operation: **China (Beijing)**, **China (Shanghai)**, and **Singapore**.
 * *   After you call the [AddAITemplate](https://help.aliyun.com/document_detail/102930.html) operation to add an AI template, you can call this operation to modify the AI template.
 *
 * @param request UpdateAITemplateRequest
 * @return UpdateAITemplateResponse
 */
async function updateAITemplate(request: UpdateAITemplateRequest): UpdateAITemplateResponse {
  var runtime = new $RuntimeOptions{};
  return updateAITemplateWithOptions(request, runtime);
}

model UpdateAppInfoRequest {
  appId?: string(name='AppId', description='The ID of the application.

*   Default value: **app-1000000**.
*   For more information, see [Overview](https://help.aliyun.com/document_detail/113600.html).

This parameter is required.', example='app-****'),
  appName?: string(name='AppName', description='The name of the application.

*   The name can contain up to 128 characters in length, including Chinese letters, digits, and periods (.), dash (-), and at character (@).
*   The name can contain only UTF-8 characters.', example='test'),
  description?: string(name='Description', description='The description of the application.

*   The description can contain up to 512 characters in length.
*   The description can contain only UTF-8 characters.', example='my first app.'),
  status?: string(name='Status', description='The status of the application. Valid values:

*   **Normal**
*   **Disable**', example='Disable'),
}

model UpdateAppInfoResponseBody = {
  requestId?: string(name='RequestId', description='The ID of the request.', example='25818875-5F78-4A13-DF45-D7393642****'),
}

model UpdateAppInfoResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: UpdateAppInfoResponseBody(name='body'),
}

/**
 * @summary Updates the information about an application.
 *
 * @description ## QPS limit
 * A single user can perform a maximum of 30 queries per second (QPS). Throttling is triggered when the number of calls per second exceeds the QPS limit. The throttling may affect your business. Thus, we recommend that you observe the QPS limit on this operation.
 *
 * @param request UpdateAppInfoRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return UpdateAppInfoResponse
 */
async function updateAppInfoWithOptions(request: UpdateAppInfoRequest, runtime: $RuntimeOptions): UpdateAppInfoResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.appId)) {
    query['AppId'] = request.appId;
  }
  if (!$isNull(request.appName)) {
    query['AppName'] = request.appName;
  }
  if (!$isNull(request.description)) {
    query['Description'] = request.description;
  }
  if (!$isNull(request.status)) {
    query['Status'] = request.status;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'UpdateAppInfo',
    version = '2017-03-21',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Updates the information about an application.
 *
 * @description ## QPS limit
 * A single user can perform a maximum of 30 queries per second (QPS). Throttling is triggered when the number of calls per second exceeds the QPS limit. The throttling may affect your business. Thus, we recommend that you observe the QPS limit on this operation.
 *
 * @param request UpdateAppInfoRequest
 * @return UpdateAppInfoResponse
 */
async function updateAppInfo(request: UpdateAppInfoRequest): UpdateAppInfoResponse {
  var runtime = new $RuntimeOptions{};
  return updateAppInfoWithOptions(request, runtime);
}

model UpdateAttachedMediaInfosRequest {
  updateContent?: string(name='UpdateContent', description='The new information about the one or more images. You can modify the information about up to 20 auxiliary media assets at a time. For more information, see the **UpdateContent** section of this topic.

> *   You cannot specify emojis for `Title`, `Description`, or `Tags`.
> *   The specific parameter of a video is updated only when a new value is passed in the parameter.

This parameter is required.', example='[{"MediaId ":"bbc65bba53f6ed90de118a7849****","Title":" test title1","Description":"test description1","Tags":"tag1,tag2"},{"MediaId ":"f45cf4eba5cb90233389558c39****","Title2":"test title2","Description2":"test description2","Tags":"tag3,tag4"}]'),
}

model UpdateAttachedMediaInfosResponseBody = {
  nonExistMediaIds?: [ string ](name='NonExistMediaIds', description='The IDs of the auxiliary media assets that do not exist.'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='25818875-5F78-4DF6-D7393642CA58****'),
}

model UpdateAttachedMediaInfosResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: UpdateAttachedMediaInfosResponseBody(name='body'),
}

/**
 * @summary Modifies the information about multiple auxiliary media assets such as watermark images, subtitle files, and materials in a batch based on IDs. You can modify information such as the title, description, tags, and category.
 *
 * @description You can modify the information about up to 20 auxiliary media assets at a time.
 *
 * @param request UpdateAttachedMediaInfosRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return UpdateAttachedMediaInfosResponse
 */
async function updateAttachedMediaInfosWithOptions(request: UpdateAttachedMediaInfosRequest, runtime: $RuntimeOptions): UpdateAttachedMediaInfosResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.updateContent)) {
    query['UpdateContent'] = request.updateContent;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'UpdateAttachedMediaInfos',
    version = '2017-03-21',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Modifies the information about multiple auxiliary media assets such as watermark images, subtitle files, and materials in a batch based on IDs. You can modify information such as the title, description, tags, and category.
 *
 * @description You can modify the information about up to 20 auxiliary media assets at a time.
 *
 * @param request UpdateAttachedMediaInfosRequest
 * @return UpdateAttachedMediaInfosResponse
 */
async function updateAttachedMediaInfos(request: UpdateAttachedMediaInfosRequest): UpdateAttachedMediaInfosResponse {
  var runtime = new $RuntimeOptions{};
  return updateAttachedMediaInfosWithOptions(request, runtime);
}

model UpdateCategoryRequest {
  cateId?: long(name='CateId', description='The ID of the category. You can specify only one ID. You can use one of the following methods to obtain the ID:

*   Log on to the [ApsaraVideo VOD console](https://vod.console.aliyun.com). Choose **Configuration Management** > **Media Management** > **Categories**. On the **Audio and Video / Image Category** or **Short Video Material Category** tab, view the category ID.
*   Obtain the category ID from the response to the [AddCategory](~~AddCategory~~) operation.

This parameter is required.', example='10020****'),
  cateName?: string(name='CateName', description='The name of the category.

*   The value can be up to 64 bytes in length.
*   The value must be encoded in UTF-8.

This parameter is required.', example='beauty'),
}

model UpdateCategoryResponseBody = {
  requestId?: string(name='RequestId', description='The ID of the request.', example='25818875-5F78-4AF6-D7393642CA58****'),
}

model UpdateCategoryResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: UpdateCategoryResponseBody(name='body'),
}

/**
 * @summary Modifies a video category.
 *
 * @description After you create a category, you can call this operation to modify the name of the category. If you have classified specific media resources to this category, the category names that are labeled on the media resources are automatically updated.
 *
 * @param request UpdateCategoryRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return UpdateCategoryResponse
 */
async function updateCategoryWithOptions(request: UpdateCategoryRequest, runtime: $RuntimeOptions): UpdateCategoryResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.cateId)) {
    query['CateId'] = request.cateId;
  }
  if (!$isNull(request.cateName)) {
    query['CateName'] = request.cateName;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'UpdateCategory',
    version = '2017-03-21',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Modifies a video category.
 *
 * @description After you create a category, you can call this operation to modify the name of the category. If you have classified specific media resources to this category, the category names that are labeled on the media resources are automatically updated.
 *
 * @param request UpdateCategoryRequest
 * @return UpdateCategoryResponse
 */
async function updateCategory(request: UpdateCategoryRequest): UpdateCategoryResponse {
  var runtime = new $RuntimeOptions{};
  return updateCategoryWithOptions(request, runtime);
}

model UpdateEditingProjectRequest {
  coverURL?: string(name='CoverURL', description='The thumbnail URL of the online editing project.', example='https://****.com/6AB4D0E1E1C7446888****.png'),
  description?: string(name='Description', description='The description of the online editing project.', example='testtimeline001desciption'),
  ownerAccount?: string(name='OwnerAccount'),
  ownerId?: string(name='OwnerId'),
  projectId?: string(name='ProjectId', description='The ID of the online editing project.

This parameter is required.', example='4ee4b97e27*****b525142a6b2'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: string(name='ResourceOwnerId'),
  timeline?: string(name='Timeline', description='The timeline of the online editing project. For more information about the structure, see [Timeline](https://help.aliyun.com/document_detail/52839.html).', example='{"VideoTracks":[{"VideoTrackClips":[{"MediaId":"cc3308ac500c*****a54328bc3443"},{"MediaId":"da87a9cff64*****d88bc6d8326e4"}]}]}'),
  title?: string(name='Title', description='The title of the online editing project.', example='testtimeline'),
}

model UpdateEditingProjectResponseBody = {
  requestId?: string(name='RequestId', description='The ID of the request.', example='25818875-5F78-4A*****F6-D7393642CA58'),
}

model UpdateEditingProjectResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: UpdateEditingProjectResponseBody(name='body'),
}

/**
 * @summary Modifies an online editing project.
 *
 * @param request UpdateEditingProjectRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return UpdateEditingProjectResponse
 */
async function updateEditingProjectWithOptions(request: UpdateEditingProjectRequest, runtime: $RuntimeOptions): UpdateEditingProjectResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.coverURL)) {
    query['CoverURL'] = request.coverURL;
  }
  if (!$isNull(request.description)) {
    query['Description'] = request.description;
  }
  if (!$isNull(request.ownerAccount)) {
    query['OwnerAccount'] = request.ownerAccount;
  }
  if (!$isNull(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!$isNull(request.projectId)) {
    query['ProjectId'] = request.projectId;
  }
  if (!$isNull(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!$isNull(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  if (!$isNull(request.timeline)) {
    query['Timeline'] = request.timeline;
  }
  if (!$isNull(request.title)) {
    query['Title'] = request.title;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'UpdateEditingProject',
    version = '2017-03-21',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Modifies an online editing project.
 *
 * @param request UpdateEditingProjectRequest
 * @return UpdateEditingProjectResponse
 */
async function updateEditingProject(request: UpdateEditingProjectRequest): UpdateEditingProjectResponse {
  var runtime = new $RuntimeOptions{};
  return updateEditingProjectWithOptions(request, runtime);
}

model UpdateImageInfosRequest {
  updateContent?: string(name='UpdateContent', description='The new information about the one or more images. You can modify the information about up to 20 images at a time. For more information about the parameter structure, see the **UpdateContent** section.

>  The values of the nested parameters Title, Description, and Tags under the UpdateContent parameter cannot contain emoticons.

This parameter is required.', example='[{"ImageId":"ff8fe57e3461416c6a267a4e09****","Title":"test title","Description":"test description","Tags":"tag1,tag2"}]'),
}

model UpdateImageInfosResponseBody = {
  nonExistImageIds?: {
    imageId?: [ string ](name='ImageId')
  }(name='NonExistImageIds', description='The IDs of the images that do not exist.'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='25818875-5F78-4AF6-D7393642CA58****'),
}

model UpdateImageInfosResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: UpdateImageInfosResponseBody(name='body'),
}

/**
 * @summary Modifies the information about one or more images at a time.
 *
 * @description *   You can call this operation to modify information such as the title, tags, description, and category about images based on image IDs. You must pass in the parameters that you want to modify. Otherwise, parameter configurations are not overwritten.
 * *   You can modify the information about up to 20 images at a time.
 *
 * @param request UpdateImageInfosRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return UpdateImageInfosResponse
 */
async function updateImageInfosWithOptions(request: UpdateImageInfosRequest, runtime: $RuntimeOptions): UpdateImageInfosResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.updateContent)) {
    query['UpdateContent'] = request.updateContent;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'UpdateImageInfos',
    version = '2017-03-21',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Modifies the information about one or more images at a time.
 *
 * @description *   You can call this operation to modify information such as the title, tags, description, and category about images based on image IDs. You must pass in the parameters that you want to modify. Otherwise, parameter configurations are not overwritten.
 * *   You can modify the information about up to 20 images at a time.
 *
 * @param request UpdateImageInfosRequest
 * @return UpdateImageInfosResponse
 */
async function updateImageInfos(request: UpdateImageInfosRequest): UpdateImageInfosResponse {
  var runtime = new $RuntimeOptions{};
  return updateImageInfosWithOptions(request, runtime);
}

model UpdateMediaStorageClassRequest {
  allowUpdateWithoutTimeLimit?: boolean(name='AllowUpdateWithoutTimeLimit', description='Specifies whether to change the storage class of a media asset that is stored for less than the minimum storage duration. Valid values:

*   **true**
*   **false**

>  If you forcibly change the storage class of a media asset that is stored for less than the minimum storage duration, additional data retrieval fees are incurred.', example='false'),
  mediaIds?: string(name='MediaIds', description='The media asset ID. You can specify a maximum of 20 IDs. Separate multiple IDs with commas (,). You can use one of the following methods to obtain the ID:

*   Log on to the [ApsaraVideo VOD](https://vod.console.aliyun.com) console. In the left-side navigation pane, choose **Media Files** > **Audio/Video**. On the Video and Audio page, you can view the ID of the media asset. This method is applicable to files that are uploaded by using the ApsaraVideo VOD console.
*   Obtain the value of the VideoId parameter from the response to the [CreateUploadVideo](https://help.aliyun.com/document_detail/55407.html) operation that you call to upload media assets.
*   Obtain the value of the VideoId parameter from the response to the [SearchMedia](https://help.aliyun.com/document_detail/86044.html) operation that you call to query the media ID after the media asset is uploaded.

This parameter is required.', example='d56c2ac0cee271ed80004710b5ba****'),
  restoreTier?: string(name='RestoreTier', description='The restoration priority. This parameter is required only when you restore a Cold Archive media asset. Valid values:

*   **Expedited**
*   **Standard**
*   **Bulk**', example='Standard'),
  scope?: string(name='Scope', description='The modification range. Valid values:

*   **All**: modifies the storage classes of all resources including the source files and transcoded streams.
*   **SourceFile**: modifies the storage classes of only the source files. The storage class of other resources is Standard.', example='All'),
  storageClass?: string(name='StorageClass', description='The storage class. Valid values:

*   **Standard**
*   **IA**
*   **Archive**
*   **ColdArchive**

This parameter is required.', example='Archive'),
}

model UpdateMediaStorageClassResponseBody = {
  forbiddenList?: {
    mediaForbiddenReasonDTO?: [ 
    {
      mediaId?: string(name='MediaId', description='The ID of the media asset.', example='19e231ee6e3e417fbf2e92ec2680****'),
      reason?: string(name='Reason', description='The reason for the failure.', example='TargetStorageClassInconsistent'),
    }
  ](name='MediaForbiddenReasonDTO')
  }(name='ForbiddenList', description='The IDs of the media assets that failed to be processed.'),
  ignoredList?: {
    mediaId?: [ string ](name='MediaId')
  }(name='IgnoredList', description='The IDs of the media assets that failed to be obtained.'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='30FA0B7C-3A81-5449-93CD-ACA149E6****'),
  status?: string(name='Status', description='The state of the task. Valid values:

*   **Processing**
*   **Failed**', example='Processing'),
}

model UpdateMediaStorageClassResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: UpdateMediaStorageClassResponseBody(name='body'),
}

/**
 * @summary Modifies the storage classes of media assets.
 *
 * @description *   This operation is an asynchronous operation. You can call this operation to modify the storage classes of media assets. After the storage class is modified, a callback notification is sent.
 * *   If the storage class of the media asset is Archive or Cold Archive and you call this operation to modify the storage class of the media asset, the media asset is automatically restored before the storage class is modified. You do not need to call the RestoreMedia operation to restore the media asset. You must specify the restoration priority for Cold Archive objects. Default configuration: RestoreTier=Standard.
 * *   Media assets whose storage classes are being modified cannot be used or processed.
 * *   Non-Standard objects have minimum storage durations. If an object is stored for less than the minimum storage duration, the storage class of the object cannot be changed. The following content describes the minimum storage durations for objects in different storage classes: IA or IA storage for source files: 30 days, Archive or Archive storage for source files: 60 days, Cold Archive or Cold Archive for source files: 180 days.
 *
 * @param request UpdateMediaStorageClassRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return UpdateMediaStorageClassResponse
 */
async function updateMediaStorageClassWithOptions(request: UpdateMediaStorageClassRequest, runtime: $RuntimeOptions): UpdateMediaStorageClassResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.allowUpdateWithoutTimeLimit)) {
    query['AllowUpdateWithoutTimeLimit'] = request.allowUpdateWithoutTimeLimit;
  }
  if (!$isNull(request.mediaIds)) {
    query['MediaIds'] = request.mediaIds;
  }
  if (!$isNull(request.restoreTier)) {
    query['RestoreTier'] = request.restoreTier;
  }
  if (!$isNull(request.scope)) {
    query['Scope'] = request.scope;
  }
  if (!$isNull(request.storageClass)) {
    query['StorageClass'] = request.storageClass;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'UpdateMediaStorageClass',
    version = '2017-03-21',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Modifies the storage classes of media assets.
 *
 * @description *   This operation is an asynchronous operation. You can call this operation to modify the storage classes of media assets. After the storage class is modified, a callback notification is sent.
 * *   If the storage class of the media asset is Archive or Cold Archive and you call this operation to modify the storage class of the media asset, the media asset is automatically restored before the storage class is modified. You do not need to call the RestoreMedia operation to restore the media asset. You must specify the restoration priority for Cold Archive objects. Default configuration: RestoreTier=Standard.
 * *   Media assets whose storage classes are being modified cannot be used or processed.
 * *   Non-Standard objects have minimum storage durations. If an object is stored for less than the minimum storage duration, the storage class of the object cannot be changed. The following content describes the minimum storage durations for objects in different storage classes: IA or IA storage for source files: 30 days, Archive or Archive storage for source files: 60 days, Cold Archive or Cold Archive for source files: 180 days.
 *
 * @param request UpdateMediaStorageClassRequest
 * @return UpdateMediaStorageClassResponse
 */
async function updateMediaStorageClass(request: UpdateMediaStorageClassRequest): UpdateMediaStorageClassResponse {
  var runtime = new $RuntimeOptions{};
  return updateMediaStorageClassWithOptions(request, runtime);
}

model UpdateTranscodeTemplateGroupRequest {
  locked?: string(name='Locked', description='The lock status of the transcoding template group. Valid values:

*   **Enabled**: The transcoding template group is locked and cannot be modified.
*   **Disabled** (default): The transcoding template group is not locked.', example='Disabled'),
  name?: string(name='Name', description='The name of the transcoding template group.

*   The name cannot exceed 128 bytes.
*   The value must be encoded in UTF-8.', example='transcodetemplate'),
  transcodeTemplateGroupId?: string(name='TranscodeTemplateGroupId', description='The ID of the transcoding template group.

This parameter is required.', example='4c71a339fe*****52b4fa6f4527'),
  transcodeTemplateList?: string(name='TranscodeTemplateList', description='The configurations of the transcoding template. The value must be a JSON string. For more information about the data structure, see [TranscodeTemplate](~~52839#title-9mb-8o2-uu6~~).', example='[{"Video":{"Bitrate":"400","Codec":"H.264","Fps":"30"},"Audio":{"Codec":"AAC","Bitrate":"64","Definition":"SD","EncryptType":"Private","Container":{"Format":"m3u8"},"PackageType":"HLSPackage"}}]'),
}

model UpdateTranscodeTemplateGroupResponseBody = {
  requestId?: string(name='RequestId', description='The ID of the request.', example='25818875-5F78-4A*****F6-D7393642CA58'),
  transcodeTemplateGroupId?: string(name='TranscodeTemplateGroupId', description='The ID of the transcoding template group.', example='34e908aa4024a*****f7821c31f93a2a'),
}

model UpdateTranscodeTemplateGroupResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: UpdateTranscodeTemplateGroupResponseBody(name='body'),
}

/**
 * @summary Modifies the configurations of a transcoding template group or configurations of transcoding templates in the transcoding template group.
 *
 * @description For security purposes, you cannot add, modify, or delete transcoding templates in a transcoding template group that is locked. You can call the [GetTranscodeTemplateGroup](~~GetTranscodeTemplateGroup~~) operation to query the configurations of a transcoding template group, check whether the transcoding template group is locked by using the response parameter Locked, and unlock the transcoding template group before you perform operations such as add, modify, and delete transcoding templates.
 *
 * @param request UpdateTranscodeTemplateGroupRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return UpdateTranscodeTemplateGroupResponse
 */
async function updateTranscodeTemplateGroupWithOptions(request: UpdateTranscodeTemplateGroupRequest, runtime: $RuntimeOptions): UpdateTranscodeTemplateGroupResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.locked)) {
    query['Locked'] = request.locked;
  }
  if (!$isNull(request.name)) {
    query['Name'] = request.name;
  }
  if (!$isNull(request.transcodeTemplateGroupId)) {
    query['TranscodeTemplateGroupId'] = request.transcodeTemplateGroupId;
  }
  if (!$isNull(request.transcodeTemplateList)) {
    query['TranscodeTemplateList'] = request.transcodeTemplateList;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'UpdateTranscodeTemplateGroup',
    version = '2017-03-21',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Modifies the configurations of a transcoding template group or configurations of transcoding templates in the transcoding template group.
 *
 * @description For security purposes, you cannot add, modify, or delete transcoding templates in a transcoding template group that is locked. You can call the [GetTranscodeTemplateGroup](~~GetTranscodeTemplateGroup~~) operation to query the configurations of a transcoding template group, check whether the transcoding template group is locked by using the response parameter Locked, and unlock the transcoding template group before you perform operations such as add, modify, and delete transcoding templates.
 *
 * @param request UpdateTranscodeTemplateGroupRequest
 * @return UpdateTranscodeTemplateGroupResponse
 */
async function updateTranscodeTemplateGroup(request: UpdateTranscodeTemplateGroupRequest): UpdateTranscodeTemplateGroupResponse {
  var runtime = new $RuntimeOptions{};
  return updateTranscodeTemplateGroupWithOptions(request, runtime);
}

model UpdateVideoInfoRequest {
  cateId?: long(name='CateId', description='The category ID. You can use one of the following methods to obtain the ID:

*   Log on to the [ApsaraVideo VOD console](https://vod.console.aliyun.com). In the left-side navigation pane, choose **Configuration Management** > **Media Management** > **Categories** to view the category ID of the media file.
*   View the value of the CateId parameter returned by the [AddCategory](https://help.aliyun.com/document_detail/56401.html) operation that you called to create a category.
*   View the value of the CateId parameter returned by the [GetCategories](https://help.aliyun.com/document_detail/56406.html) operation that you called to query a category.', example='384761111'),
  coverURL?: string(name='CoverURL', description='The URL of the audio/video thumbnail.', example='https://example.aliyundoc.com/****.jpg'),
  description?: string(name='Description', description='The description of the audio or video file.

*   The description can be up to 1,024 bytes in length.
*   The value is encoded in UTF-8.', example='video description'),
  tags?: string(name='Tags', description='The tags of the media file.

*   Each tag can be up to 32 bytes in length. You can specify up to 16 tags.
*   Separate multiple tags with commas (,).
*   The value is encoded in UTF-8.', example='tag1,tag2'),
  title?: string(name='Title', description='The title of the audio or video file.

*   The name cannot exceed 128 bytes.
*   The value is encoded in UTF-8.', example='video title'),
  userData?: string(name='UserData', description='Custom settings. This is a JSON string that supports message callbacks, upload acceleration, and other settings. For more information, please refer to [UserData](https://help.aliyun.com/document_detail/86952.html).', example='{"MessageCallback":{"CallbackURL":"http://example.aliyundoc.com"},"Extend":{"localId":"*****","test":"www"}}'),
  videoId?: string(name='VideoId', description='The ID of the audio or video file. Perform the following operations to obtain the storage address:

*   Log on to the [ApsaraVideo VOD console](https://vod.console.aliyun.com). In the left-side navigation pane, choose **Media Files** > **Audio/Video**. On the Video and Audio page, view the ID of the audio or video file. This method is applicable to files that are uploaded by using the ApsaraVideo VOD console.
*   Obtain the value of VideoId from the response to the [CreateUploadVideo](https://help.aliyun.com/document_detail/55407.html) operation that you called to obtain the upload URL and credential.
*   View the value of the VideoId parameter returned by the [SearchMedia](https://help.aliyun.com/document_detail/86044.html) operation that you called to query media information after the audio or video file is uploaded.

This parameter is required.', example='2deda93265312baf9b0ed810d****'),
}

model UpdateVideoInfoResponseBody = {
  requestId?: string(name='RequestId', description='The request ID.', example='25818875-5F78-4AF6-D7393642CA58****'),
}

model UpdateVideoInfoResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: UpdateVideoInfoResponseBody(name='body'),
}

/**
 * @summary Modifies the information about an audio or video file.
 *
 * @description ### [](#)
 * You can call this operation to modify information such as the title, tags, and description about audio and video files based on audio or video IDs. You must pass in the parameters that you want to modify. Otherwise, parameter configurations are not overwritten.
 * ### [](#qps-)Queries per second (QPS) limit
 * You can call this operation up to 100 times per second per account. Requests that exceed this limit are dropped and you may experience service interruptions. We recommend that you take note of this limit when you call this operation. For more information, see [QPS limits on API operations](https://help.aliyun.com/document_detail/342790.html).
 *
 * @param request UpdateVideoInfoRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return UpdateVideoInfoResponse
 */
async function updateVideoInfoWithOptions(request: UpdateVideoInfoRequest, runtime: $RuntimeOptions): UpdateVideoInfoResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.cateId)) {
    query['CateId'] = request.cateId;
  }
  if (!$isNull(request.coverURL)) {
    query['CoverURL'] = request.coverURL;
  }
  if (!$isNull(request.description)) {
    query['Description'] = request.description;
  }
  if (!$isNull(request.tags)) {
    query['Tags'] = request.tags;
  }
  if (!$isNull(request.title)) {
    query['Title'] = request.title;
  }
  if (!$isNull(request.userData)) {
    query['UserData'] = request.userData;
  }
  if (!$isNull(request.videoId)) {
    query['VideoId'] = request.videoId;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'UpdateVideoInfo',
    version = '2017-03-21',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Modifies the information about an audio or video file.
 *
 * @description ### [](#)
 * You can call this operation to modify information such as the title, tags, and description about audio and video files based on audio or video IDs. You must pass in the parameters that you want to modify. Otherwise, parameter configurations are not overwritten.
 * ### [](#qps-)Queries per second (QPS) limit
 * You can call this operation up to 100 times per second per account. Requests that exceed this limit are dropped and you may experience service interruptions. We recommend that you take note of this limit when you call this operation. For more information, see [QPS limits on API operations](https://help.aliyun.com/document_detail/342790.html).
 *
 * @param request UpdateVideoInfoRequest
 * @return UpdateVideoInfoResponse
 */
async function updateVideoInfo(request: UpdateVideoInfoRequest): UpdateVideoInfoResponse {
  var runtime = new $RuntimeOptions{};
  return updateVideoInfoWithOptions(request, runtime);
}

model UpdateVideoInfosRequest {
  updateContent?: string(name='UpdateContent', description='The new information about audios or videos. You can modify the information about up to 20 audios or videos at a time. Separate multiple audios or videos with commas (,). When you modify the information exceed 20 audios or videos at a time, the update will fail with an error code **CountExceededMax**.

The value is a JSON string. For more information, see the **UpdateContent** section of this topic.

This parameter is required.', example='[{"VideoId":"f45cf4eba5cb90233389558c39****","Title":"test title1"},{"VideoId":"f45cf4eba5c84233389558c36****","Title":"test title2"}]'),
}

model UpdateVideoInfosResponseBody = {
  forbiddenVideoIds?: [ string ](name='ForbiddenVideoIds', description='The IDs of the videos that cannot be modified. Generally, videos cannot be modified if you do not have required [permissions](https://help.aliyun.com/document_detail/113600.html).'),
  nonExistVideoIds?: [ string ](name='NonExistVideoIds', description='The IDs of the videos that do not exist.'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='25818875-5F78-4AF6-D7393642CA58****'),
}

model UpdateVideoInfosResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: UpdateVideoInfosResponseBody(name='body'),
}

/**
 * @summary Modifies the information about multiple videos at a time.
 *
 * @description The specific parameter of a video is updated only when a new value is passed in the parameter.
 *
 * @param request UpdateVideoInfosRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return UpdateVideoInfosResponse
 */
async function updateVideoInfosWithOptions(request: UpdateVideoInfosRequest, runtime: $RuntimeOptions): UpdateVideoInfosResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.updateContent)) {
    query['UpdateContent'] = request.updateContent;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'UpdateVideoInfos',
    version = '2017-03-21',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Modifies the information about multiple videos at a time.
 *
 * @description The specific parameter of a video is updated only when a new value is passed in the parameter.
 *
 * @param request UpdateVideoInfosRequest
 * @return UpdateVideoInfosResponse
 */
async function updateVideoInfos(request: UpdateVideoInfosRequest): UpdateVideoInfosResponse {
  var runtime = new $RuntimeOptions{};
  return updateVideoInfosWithOptions(request, runtime);
}

model UpdateVodDomainRequest {
  domainName?: string(name='DomainName', description='The domain name.

This parameter is required.', example='example.com'),
  ownerId?: long(name='OwnerId'),
  securityToken?: string(name='SecurityToken'),
  sources?: string(name='Sources', description='The information about the addresses of origin servers.', example='[{"content":"1.1.1.1","type":"ipaddr","priority":"20","port":80}]'),
  topLevelDomain?: string(name='TopLevelDomain', description='The top-level domain.', example='example.com'),
}

model UpdateVodDomainResponseBody = {
  requestId?: string(name='RequestId', description='The request ID.', example='15C66C7B-671A-4297-****-2C4477247A74'),
}

model UpdateVodDomainResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: UpdateVodDomainResponseBody(name='body'),
}

/**
 * @summary Modifies a specific accelerated domain name.
 *
 * @description UpdateVodDomain
 *
 * @param request UpdateVodDomainRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return UpdateVodDomainResponse
 */
async function updateVodDomainWithOptions(request: UpdateVodDomainRequest, runtime: $RuntimeOptions): UpdateVodDomainResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.domainName)) {
    query['DomainName'] = request.domainName;
  }
  if (!$isNull(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!$isNull(request.securityToken)) {
    query['SecurityToken'] = request.securityToken;
  }
  if (!$isNull(request.sources)) {
    query['Sources'] = request.sources;
  }
  if (!$isNull(request.topLevelDomain)) {
    query['TopLevelDomain'] = request.topLevelDomain;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'UpdateVodDomain',
    version = '2017-03-21',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Modifies a specific accelerated domain name.
 *
 * @description UpdateVodDomain
 *
 * @param request UpdateVodDomainRequest
 * @return UpdateVodDomainResponse
 */
async function updateVodDomain(request: UpdateVodDomainRequest): UpdateVodDomainResponse {
  var runtime = new $RuntimeOptions{};
  return updateVodDomainWithOptions(request, runtime);
}

model UpdateVodTemplateRequest {
  name?: string(name='Name', description='The name of the template.

*   The name can be up to 128 bytes in length.
*   The value must be encoded in UTF-8.', example='test'),
  templateConfig?: string(name='TemplateConfig', description='The configurations of the snapshot template. The value is a JSON-formatted string. For more information about the data structure, see the "SnapshotTemplateConfig" section of the [Media processing parameters](https://help.aliyun.com/document_detail/98618.html) topic.', example='{"SnapshotConfig":{"Count":10,"SpecifiedOffsetTime":0,"Interval":1}'),
  vodTemplateId?: string(name='VodTemplateId', description='The ID of the snapshot template.

This parameter is required.', example='8c75a02e339b*****0b0d2c48171a22'),
}

model UpdateVodTemplateResponseBody = {
  requestId?: string(name='RequestId', description='The ID of the request.', example='25818875-5F78-4A*****F6-D7393642CA58'),
  vodTemplateId?: string(name='VodTemplateId', description='The ID of the snapshot template.', example='8c75a02e339b*****0b0d2c48171a22'),
}

model UpdateVodTemplateResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: UpdateVodTemplateResponseBody(name='body'),
}

/**
 * @summary Modifies a snapshot template.
 *
 * @param request UpdateVodTemplateRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return UpdateVodTemplateResponse
 */
async function updateVodTemplateWithOptions(request: UpdateVodTemplateRequest, runtime: $RuntimeOptions): UpdateVodTemplateResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.name)) {
    query['Name'] = request.name;
  }
  if (!$isNull(request.templateConfig)) {
    query['TemplateConfig'] = request.templateConfig;
  }
  if (!$isNull(request.vodTemplateId)) {
    query['VodTemplateId'] = request.vodTemplateId;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'UpdateVodTemplate',
    version = '2017-03-21',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Modifies a snapshot template.
 *
 * @param request UpdateVodTemplateRequest
 * @return UpdateVodTemplateResponse
 */
async function updateVodTemplate(request: UpdateVodTemplateRequest): UpdateVodTemplateResponse {
  var runtime = new $RuntimeOptions{};
  return updateVodTemplateWithOptions(request, runtime);
}

model UpdateWatermarkRequest {
  name?: string(name='Name', description='The name of the watermark template to which you want to change.

*   Only letters and digits are supported.
*   The name cannot exceed 128 bytes.
*   The value must be encoded in UTF-8.', example='test'),
  watermarkConfig?: string(name='WatermarkConfig', description='The configuration information of the watermark such as the display position and special effects. The value must be a JSON string. The configuration parameters for image and text watermarks are different. For more information about the parameter structure, see [WatermarkConfig](~~98618#section-h01-44s-2lr~~).

This parameter is required.', example='{"Width":"55","Height":"55","Dx":"9","Dy":"9","ReferPos":"BottonLeft","Type":"Image"}'),
  watermarkId?: string(name='WatermarkId', description='The ID of the watermark template. You can specify only one watermark template ID. You can obtain the ID by using one of the following methods:

*   Obtain the watermark template ID from the response to the [AddWatermark](~~AddWatermark~~) operation that you call to create a watermark template.
*   Obtain the watermark template ID from the response to the [ListWatermark](~~ListWatermark~~) operation that you call to query all watermark templates within your account.

This parameter is required.', example='af2afe4761992c*****bd947dae97337'),
}

model UpdateWatermarkResponseBody = {
  requestId?: string(name='RequestId', description='The ID of the request.', example='25818875-5F78-4A*****F6-D7393642CA58'),
  watermarkInfo?: {
    creationTime?: string(name='CreationTime', description='The time when the watermark template was created. The time follows the ISO 8601 standard in the *yyyy-MM-dd*T*HH:mm:ss*Z format. The time is displayed in UTC.', example='2018-11-06T08:03:17Z'),
    fileUrl?: string(name='FileUrl', description='The URL of the watermark file. The URL is an Object Storage Service (OSS) URL or an Alibaba Cloud CDN URL.

>  This parameter is returned only for image watermark templates.', example='https://outin-32****9f4b3e7.oss-cn-shanghai.aliyuncs.com/image/cover/E6C3448CC8B715E6F8A72EC6B-6-2.png?Expires=1541600583&OSSAccessKeyId=****&Signature=gmf1eYMoDVg%2BHQCb4UGozBW****'),
    isDefault?: string(name='IsDefault', description='Indicates whether the watermark template is the default one.

*   **Default**
*   **NotDefault**', example='NotDefault'),
    name?: string(name='Name', description='The name of the watermark template.', example='image watermark test'),
    type?: string(name='Type', description='The type of the watermark template.

*   **Image**: image watermark template
*   **Text**: text watermark template', example='Text'),
    watermarkConfig?: string(name='WatermarkConfig', description='The configuration information of the watermark such as the display position and special effects. The value is a JSON string. The configuration parameters for image and text watermarks are different. For more information about the parameter structure, see [WatermarkConfig](~~98618#section-h01-44s-2lr~~).', example='{"Width":"55","Height":"55","Dx":"9","Dy":"9","ReferPos":"BottonLeft","Type":"Image"}'),
    watermarkId?: string(name='WatermarkId', description='The ID of the watermark template.', example='505e2e287ea*****ecfddd386d384'),
  }(name='WatermarkInfo', description='The information about the watermark template.'),
}

model UpdateWatermarkResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: UpdateWatermarkResponseBody(name='body'),
}

/**
 * @summary Modifies the name and configurations of a watermark template after you create a watermark template.
 *
 * @description *   You can modify the name and configurations of the watermark template after you call the [AddWatermark](~~AddWatermark~~) operation to create a watermark template.
 * *   You cannot call this operation to change the image in an image watermark template.
 *
 * @param request UpdateWatermarkRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return UpdateWatermarkResponse
 */
async function updateWatermarkWithOptions(request: UpdateWatermarkRequest, runtime: $RuntimeOptions): UpdateWatermarkResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.name)) {
    query['Name'] = request.name;
  }
  if (!$isNull(request.watermarkConfig)) {
    query['WatermarkConfig'] = request.watermarkConfig;
  }
  if (!$isNull(request.watermarkId)) {
    query['WatermarkId'] = request.watermarkId;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'UpdateWatermark',
    version = '2017-03-21',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Modifies the name and configurations of a watermark template after you create a watermark template.
 *
 * @description *   You can modify the name and configurations of the watermark template after you call the [AddWatermark](~~AddWatermark~~) operation to create a watermark template.
 * *   You cannot call this operation to change the image in an image watermark template.
 *
 * @param request UpdateWatermarkRequest
 * @return UpdateWatermarkResponse
 */
async function updateWatermark(request: UpdateWatermarkRequest): UpdateWatermarkResponse {
  var runtime = new $RuntimeOptions{};
  return updateWatermarkWithOptions(request, runtime);
}

model UploadMediaByURLRequest {
  appId?: string(name='AppId', description='The ID of the application. Default value: **app-1000000**. For more information, see [Overview](https://help.aliyun.com/document_detail/113600.html).', example='app-****'),
  sessionId?: string(name='SessionId', description='The custom identifier for deduplication. If you specify this parameter and send a request, an error is returned if a request with the same identifier was sent in the last 10 minutes. A custom identifier can be up to 50 characters in length and can contain letters, digits, hyphens (-), and underscores (_). If you do not specify this parameter or leave this parameter empty, duplicate requests are not filtered.', example='5c62d40299034bbaa4c195da330****'),
  storageLocation?: string(name='StorageLocation', description='The storage address of the media file.

To view the storage address, log on to the [ApsaraVideo VOD console](https://vod.console.aliyun.com/?spm=a2c4g.11186623.2.15.6948257eaZ4m54#/vod/settings/censored). In the left-side navigation pane, choose **Configuration Management** > **Media Management** > **Storage**. If you do not specify a storage address, the default storage address is used.', example='outin-bfefbb90a47c******163e1c7426.oss-cn-shanghai.aliyuncs.com'),
  templateGroupId?: string(name='TemplateGroupId', description='The ID of the transcoding template group. You can use one of the following methods to obtain the ID of the transcoding template group:

*   Log on to the [ApsaraVideo VOD console](https://vod.console.aliyun.com). In the left-side navigation pane, choose **Configuration Management** > **Media Processing** > **Transcoding Template Groups**. On the Transcoding Template Groups page, view the ID of the transcoding template group.
*   Obtain the value of TranscodeTemplateGroupId from the response to the [AddTranscodeTemplateGroup](https://help.aliyun.com/document_detail/102665.html) operation.
*   Obtain the value of TranscodeTemplateGroupId from the response to the [ListTranscodeTemplateGroup](https://help.aliyun.com/document_detail/102669.html) operation.

>-   If you leave this parameter empty, the default transcoding template group is used for transcoding. If you specify this parameter, the specified transcoding template group is used for transcoding.
>-   You can also specify the ID of the transcoding template group in `UploadMetadatas`. If you specify this parameter and TemplateGroupId in UploadMetadatas, the TemplateGroupId in UploadMetadatas takes effect.', example='ca3a8f6e4957b65806709586****'),
  uploadMetadatas?: string(name='UploadMetadatas', description='The metadata of the media file that you want to upload. The value must be a JSON string.

*   This parameter takes effect only if SourceURL matches the URL that you specified for UploadURLs.
*   You must convert the JSON-formatted data such as `[UploadMetadata, UploadMetadata,…]` to a JSON string.
*   For more information, see the **UploadMetadata** table.', example='[{"SourceURL":"https://example.aliyundoc.com/video01.mp4","Title":"urlUploadTest"}]'),
  uploadURLs?: string(name='UploadURLs', description='The URL of the media file.

*   You must include a file name extension in the URL, such as `https://****.mp4`.

    *   If the URL does not contain a file name extension, specify a file name extension for `FileExtension` in `UploadMetadatas`.
    *   If you specify `FileExtension` when the URL contains a file name extension, the file name extension that you specified for `FileExtension` takes effect.
    *   For more information about file name extensions supported by ApsaraVideo VOD, see [Overview](https://help.aliyun.com/document_detail/55396.html).

*   URL encoding is required. Separate multiple URLs with commas (,). You can specify a maximum of 20 URLs.

*   Special characters may cause upload failures. You must encode URLs before you separate them with commas (,).

This parameter is required.', example='https://****.mp4'),
  userData?: string(name='UserData', description='The custom configurations such as callback configurations and upload acceleration configurations. The value must be a JSON string. For more information, see [Request parameters](~~86952#UserData~~).

>-   The callback configurations take effect only after you specify the HTTP callback URL and select specific callback events in the ApsaraVideo VOD console. For more information about how to configure HTTP callback settings in the ApsaraVideo VOD console, see [Configure callback settings](https://help.aliyun.com/document_detail/86071.html).
>-   If you want to enable the upload acceleration feature, [submit a request on Yida](https://yida.alibaba-inc.com/o/ticketapply). For more information, see [Overview](https://help.aliyun.com/document_detail/55396.html).', example='{"MessageCallback":{"CallbackURL":"http://example.aliyundoc.com"},"Extend":{"localId":"xxx","test":"www"}}'),
  workflowId?: string(name='WorkflowId', description='The ID of the workflow. To view the ID of the workflow, log on to the [ApsaraVideo VOD console](https://vod.console.aliyun.com). In the left-side navigation pane, choose **Configuration Management** > **Media Processing** > **Workflows**.

> If you specify WorkflowId and TemplateGroupId, the value of WorkflowId takes effect. For more information, see [Workflows](https://help.aliyun.com/document_detail/115347.html).', example='e1e243b42548248197d6f74f9****'),
}

model UploadMediaByURLResponseBody = {
  requestId?: string(name='RequestId', description='The ID of the request.', example='25818875-5F78-4AF6-D7393642CA58****'),
  uploadJobs?: [ 
    {
      jobId?: string(name='JobId', description='The ID of the upload job.', example='ad90a501b1b94fb72374ad005046****'),
      sourceURL?: string(name='SourceURL', description='The URL of the source file that is uploaded in the upload job.', example='http://example****.mp4'),
    }
  ](name='UploadJobs', description='The ID of the upload job.'),
}

model UploadMediaByURLResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: UploadMediaByURLResponseBody(name='body'),
}

/**
 * @summary Uploads media files based on URLs.
 *
 * @description *   You can call this operation to upload media files that are not stored on a local server or device and must be uploaded based on URLs over the Internet.
 * *   The URL-based upload jobs are asynchronous. After you submit a URL-based upload job by calling this operation, it may take hours, even days to complete. If you require high timeliness, we recommend that you use the upload SDK.
 * *   If you configure callbacks, you can receive an [UploadByURLComplete](https://help.aliyun.com/document_detail/86326.html) event notification after the media file is uploaded. You can query the upload status by calling the [GetURLUploadInfos](https://help.aliyun.com/document_detail/106830.html) operation.
 * *   After you submit an upload job, the job is asynchronously processed on the cloud. All URL-based upload jobs that are submitted in each region are queued. The waiting time for the upload job depends on the number of queued jobs. After the upload job is complete, you can associate the playback URL included in the callback with the media ID.
 * *   You can call this operation only in the **China (Shanghai)** and **Singapore** regions.
 * *   Every time you submit a URL-based upload job, a new media ID is generated in ApsaraVideo VOD.
 *
 * @param request UploadMediaByURLRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return UploadMediaByURLResponse
 */
async function uploadMediaByURLWithOptions(request: UploadMediaByURLRequest, runtime: $RuntimeOptions): UploadMediaByURLResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.appId)) {
    query['AppId'] = request.appId;
  }
  if (!$isNull(request.sessionId)) {
    query['SessionId'] = request.sessionId;
  }
  if (!$isNull(request.storageLocation)) {
    query['StorageLocation'] = request.storageLocation;
  }
  if (!$isNull(request.templateGroupId)) {
    query['TemplateGroupId'] = request.templateGroupId;
  }
  if (!$isNull(request.uploadMetadatas)) {
    query['UploadMetadatas'] = request.uploadMetadatas;
  }
  if (!$isNull(request.uploadURLs)) {
    query['UploadURLs'] = request.uploadURLs;
  }
  if (!$isNull(request.userData)) {
    query['UserData'] = request.userData;
  }
  if (!$isNull(request.workflowId)) {
    query['WorkflowId'] = request.workflowId;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'UploadMediaByURL',
    version = '2017-03-21',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Uploads media files based on URLs.
 *
 * @description *   You can call this operation to upload media files that are not stored on a local server or device and must be uploaded based on URLs over the Internet.
 * *   The URL-based upload jobs are asynchronous. After you submit a URL-based upload job by calling this operation, it may take hours, even days to complete. If you require high timeliness, we recommend that you use the upload SDK.
 * *   If you configure callbacks, you can receive an [UploadByURLComplete](https://help.aliyun.com/document_detail/86326.html) event notification after the media file is uploaded. You can query the upload status by calling the [GetURLUploadInfos](https://help.aliyun.com/document_detail/106830.html) operation.
 * *   After you submit an upload job, the job is asynchronously processed on the cloud. All URL-based upload jobs that are submitted in each region are queued. The waiting time for the upload job depends on the number of queued jobs. After the upload job is complete, you can associate the playback URL included in the callback with the media ID.
 * *   You can call this operation only in the **China (Shanghai)** and **Singapore** regions.
 * *   Every time you submit a URL-based upload job, a new media ID is generated in ApsaraVideo VOD.
 *
 * @param request UploadMediaByURLRequest
 * @return UploadMediaByURLResponse
 */
async function uploadMediaByURL(request: UploadMediaByURLRequest): UploadMediaByURLResponse {
  var runtime = new $RuntimeOptions{};
  return uploadMediaByURLWithOptions(request, runtime);
}

model UploadStreamByURLRequest {
  definition?: string(name='Definition', description='The quality of the video stream.

For more information about valid values of this parameter, see [Parameters for media assets](https://help.aliyun.com/document_detail/124671.html).

This parameter is required.', example='HD'),
  fileExtension?: string(name='FileExtension', description='The file name extension of the transcoded stream.

For more information, see the Supported media file formats section in [Overview](https://help.aliyun.com/document_detail/55396.html).

If you set a value for this parameter, the file name extension specified in StreamURL is overwritten.

>  This parameter is required if you do not specify a file name extension in StreamURL.', example='mp4'),
  HDRType?: string(name='HDRType', description='The HDR type of the transcoded stream. Valid values:

*   HDR
*   HDR10
*   HLG
*   DolbyVision
*   HDRVivid
*   SDR+

> 

*   The HDR type of the transcoded stream is not case-sensitive.

*   You can leave this parameter empty for non-HDR streams.', example='HDR10'),
  mediaId?: string(name='MediaId', description='The media ID in ApsaraVideo VOD.

This parameter is required.', example='ca3a8f6e49*****57b65806709586'),
  streamURL?: string(name='StreamURL', description='The URL of the transcoded stream.

If URL authentication is required, you must pass authentication information in this parameter and make sure that the URL can be accessed over the Internet.

This parameter is required.', example='https://example.com/lesson-01.mp4'),
  uploadMetadata?: string(name='UploadMetadata', description='Metadata information for uploading media files, in JSON string format.

For more information, please refer to the table below for UploadMetadata.', example='{"AddressMapping":"1","CustomPath":"test/xxx","CustomFileName":"xxx.mp4","isOverwritePath":"0"}'),
  userData?: string(name='UserData', description='The user-defined parameter. For more information, see the "UserData: specifies the custom configurations for media upload" section of the [Request parameters](https://help.aliyun.com/document_detail/86952.html) topic.

>  The callback configurations you specify for this parameter take effect only after you specify the HTTP callback URL and select specific callback events in the ApsaraVideo VOD console. For more information about how to configure HTTP callback settings in the ApsaraVideo VOD console, see [Configure callback settings](https://help.aliyun.com/document_detail/86071.html).', example='{"MessageCallback":{"CallbackURL":"http://aliyundoc.com"}, "Extend":{"localId":"xxx","test":"www"}}'),
}

model UploadStreamByURLResponseBody = {
  fileURL?: string(name='FileURL', description='The URL of the OSS object.', example='http://outin-31059bcee7810a200163e1c8dba****.oss-cn-shanghai.aliyuncs.com/lesson-01.mp4'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='7AE96389-DF1E-598D-816B-7B40F13B4620'),
  sourceURL?: string(name='SourceURL', description='The URL of the input stream. This parameter is used when you call the [GetURLUploadInfos](https://help.aliyun.com/document_detail/106830.html) operation.', example='https://example.com/lesson-01.mp4'),
  streamJobId?: string(name='StreamJobId', description='The ID of the stream upload job. This parameter is used when you call the [GetURLUploadInfos](https://help.aliyun.com/document_detail/106830.html) operation.

In ApsaraVideo VOD, you can upload only one transcoded stream in an upload job. For more information, see the PlayInfo: the playback information about a video stream section in [Basic structures](https://help.aliyun.com/document_detail/52839.html).', example='e304b34fb3d959f92baef97b6496****'),
}

model UploadStreamByURLResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: UploadStreamByURLResponseBody(name='body'),
}

/**
 * @summary Uploads transcoded streams to ApsaraVideo VOD from external storage.
 *
 * @description *   **Make sure that you understand the billing method and price of ApsaraVideo VOD before you call this operation. You are charged storage fees after you upload media files to ApsaraVideo VOD. For more information, see [Billing of media asset storage](~~188308#section_e97_xrp_mzz~~). If you have activated the acceleration service, you are charged acceleration fees when you upload media files to ApsaraVideo VOD. For more information, see [Billing of acceleration traffic](~~188310#section_sta_zm2_tsv~~).**
 * *   This operation is available only in the **China (Shanghai)** and **Singapore** regions.
 * *   You can call this operation to upload transcoded streams to ApsaraVideo VOD from external storage. The following HDR types of transcoded streams are supported: HDR, HDR 10, HLG, Dolby Vision, HDR Vivid, and SDR+.
 * *   You can call the [GetURLUploadInfos](https://help.aliyun.com/document_detail/106830.html) operation to query the upload status. After the upload is complete, the callback of the [UploadByURLComplete](https://help.aliyun.com/document_detail/376427.html) event is returned.
 *
 * @param request UploadStreamByURLRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return UploadStreamByURLResponse
 */
async function uploadStreamByURLWithOptions(request: UploadStreamByURLRequest, runtime: $RuntimeOptions): UploadStreamByURLResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.definition)) {
    query['Definition'] = request.definition;
  }
  if (!$isNull(request.fileExtension)) {
    query['FileExtension'] = request.fileExtension;
  }
  if (!$isNull(request.HDRType)) {
    query['HDRType'] = request.HDRType;
  }
  if (!$isNull(request.mediaId)) {
    query['MediaId'] = request.mediaId;
  }
  if (!$isNull(request.streamURL)) {
    query['StreamURL'] = request.streamURL;
  }
  if (!$isNull(request.uploadMetadata)) {
    query['UploadMetadata'] = request.uploadMetadata;
  }
  if (!$isNull(request.userData)) {
    query['UserData'] = request.userData;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'UploadStreamByURL',
    version = '2017-03-21',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Uploads transcoded streams to ApsaraVideo VOD from external storage.
 *
 * @description *   **Make sure that you understand the billing method and price of ApsaraVideo VOD before you call this operation. You are charged storage fees after you upload media files to ApsaraVideo VOD. For more information, see [Billing of media asset storage](~~188308#section_e97_xrp_mzz~~). If you have activated the acceleration service, you are charged acceleration fees when you upload media files to ApsaraVideo VOD. For more information, see [Billing of acceleration traffic](~~188310#section_sta_zm2_tsv~~).**
 * *   This operation is available only in the **China (Shanghai)** and **Singapore** regions.
 * *   You can call this operation to upload transcoded streams to ApsaraVideo VOD from external storage. The following HDR types of transcoded streams are supported: HDR, HDR 10, HLG, Dolby Vision, HDR Vivid, and SDR+.
 * *   You can call the [GetURLUploadInfos](https://help.aliyun.com/document_detail/106830.html) operation to query the upload status. After the upload is complete, the callback of the [UploadByURLComplete](https://help.aliyun.com/document_detail/376427.html) event is returned.
 *
 * @param request UploadStreamByURLRequest
 * @return UploadStreamByURLResponse
 */
async function uploadStreamByURL(request: UploadStreamByURLRequest): UploadStreamByURLResponse {
  var runtime = new $RuntimeOptions{};
  return uploadStreamByURLWithOptions(request, runtime);
}

model VerifyVodDomainOwnerRequest {
  domainName?: string(name='DomainName', description='The domain name of which you want to verify the ownership. You can specify only one domain name in each call.

This parameter is required.', example='example.com'),
  ownerId?: long(name='OwnerId'),
  verifyType?: string(name='VerifyType', description='The verification method. Valid values:

*   **dnsCheck**: uses a Domain Name System (DNS) record
*   **fileCheck**: uses a verification file

This parameter is required.', example='dnsCheck'),
}

model VerifyVodDomainOwnerResponseBody = {
  content?: string(name='Content', description='The verification content.', example='verify_dffeb661*********a59c32cd91f'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='E4EBD2BF-5EB0-4476-8829-9D94E1B1****'),
}

model VerifyVodDomainOwnerResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: VerifyVodDomainOwnerResponseBody(name='body'),
}

/**
 * @summary Verifies the ownership of a specified domain name.
 *
 * @description This operation is available only in the **China (Shanghai)** region.
 *
 * @param request VerifyVodDomainOwnerRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return VerifyVodDomainOwnerResponse
 */
async function verifyVodDomainOwnerWithOptions(request: VerifyVodDomainOwnerRequest, runtime: $RuntimeOptions): VerifyVodDomainOwnerResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.domainName)) {
    query['DomainName'] = request.domainName;
  }
  if (!$isNull(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!$isNull(request.verifyType)) {
    query['VerifyType'] = request.verifyType;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'VerifyVodDomainOwner',
    version = '2017-03-21',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Verifies the ownership of a specified domain name.
 *
 * @description This operation is available only in the **China (Shanghai)** region.
 *
 * @param request VerifyVodDomainOwnerRequest
 * @return VerifyVodDomainOwnerResponse
 */
async function verifyVodDomainOwner(request: VerifyVodDomainOwnerRequest): VerifyVodDomainOwnerResponse {
  var runtime = new $RuntimeOptions{};
  return verifyVodDomainOwnerWithOptions(request, runtime);
}

